diff --git a/frontend/src/components/calendar/CalendarHelpPopover.tsx b/frontend/src/components/calendar/CalendarHelpPopover.tsx
index 647a929..a042bbd 100644
--- a/frontend/src/components/calendar/CalendarHelpPopover.tsx
+++ b/frontend/src/components/calendar/CalendarHelpPopover.tsx
@@ -16,10 +16,22 @@ const DAY_MARKS: ReadonlyArray<{ key: string; className: string; labelKey: Trans
/** The band styles: type by fill/ink/outline, owner by the left cap. */
const BAND_MARKS: ReadonlyArray<{ key: string; className: string; labelKey: TranslationKey; text?: string }> = [
{ key: 'vacation', className: 'calendar-help__band calendar-help__band--vacation', labelKey: 'calendar.helpVacation' },
- { key: 'sjukpenning', className: 'calendar-help__band calendar-help__band--sjukpenning', labelKey: 'calendar.helpSjukpenning' },
- { key: 'lagsta', className: 'calendar-help__band calendar-help__band--lagsta', labelKey: 'calendar.helpLagsta' },
- { key: 'self', className: 'calendar-help__band calendar-help__band--self', labelKey: 'calendar.helpSelf' },
- { key: 'partner', className: 'calendar-help__band calendar-help__band--partner', labelKey: 'calendar.helpPartner' },
+ {
+ key: 'sjukpenning',
+ className: 'calendar-help__band calendar-help__band--sjukpenning leave-swatch--sjukpenning',
+ labelKey: 'calendar.helpSjukpenning',
+ },
+ {
+ key: 'lagsta',
+ className: 'calendar-help__band calendar-help__band--lagsta leave-swatch--lagsta',
+ labelKey: 'calendar.helpLagsta',
+ },
+ { key: 'self', className: 'calendar-help__band calendar-help__band--self leave-swatch--cap-self', labelKey: 'calendar.helpSelf' },
+ {
+ key: 'partner',
+ className: 'calendar-help__band calendar-help__band--partner leave-swatch--cap-partner',
+ labelKey: 'calendar.helpPartner',
+ },
{ key: 'dubbeldag', className: 'calendar-help__band calendar-help__band--dubbeldag', labelKey: 'calendar.helpDubbeldag', text: '2×' },
{ key: 'pinned', className: 'calendar-help__band calendar-help__band--pinned', labelKey: 'calendar.helpPinned' },
]
diff --git a/frontend/src/components/calendar/calendar-help-popover.css b/frontend/src/components/calendar/calendar-help-popover.css
index 59be733..4fe99b2 100644
--- a/frontend/src/components/calendar/calendar-help-popover.css
+++ b/frontend/src/components/calendar/calendar-help-popover.css
@@ -127,30 +127,19 @@
color: var(--c-leave-vacation-ink);
}
+/* Fill/hatch/outline and the cap-mark shadow are the shared
+ * `.leave-swatch--*` recipe from primitives.css (added alongside these
+ * classes in CalendarHelpPopover.tsx); ink stays local since it isn't part
+ * of that shared recipe (the calendar band and year-row swatch don't set
+ * it via CSS either — see leaveTypes.ts's `getInkForType`). */
.calendar-help__band--sjukpenning {
- background-color: var(--c-leave-sjukpenning);
color: var(--c-leave-sjukpenning-ink);
}
.calendar-help__band--lagsta {
- background-color: var(--c-leave-lagsta);
- background-image: repeating-linear-gradient(
- 135deg,
- transparent 0 4px,
- var(--c-leave-lagsta-hatch) 4px 5px
- );
- box-shadow: inset 0 0 0 1px var(--c-leave-lagsta-outline);
color: var(--c-leave-lagsta-ink);
}
-.calendar-help__band--self {
- box-shadow: inset 2px 0 0 var(--c-band-cap-self);
-}
-
-.calendar-help__band--partner {
- box-shadow: inset 2px 0 0 var(--c-band-cap-partner);
-}
-
.calendar-help__band--pinned {
box-shadow: inset 0 -2px 0 var(--c-leave-vacation-ink);
}
diff --git a/frontend/src/components/common/CalendarWeek.tsx b/frontend/src/components/common/CalendarWeek.tsx
index 6fe6455..eba42d8 100644
--- a/frontend/src/components/common/CalendarWeek.tsx
+++ b/frontend/src/components/common/CalendarWeek.tsx
@@ -402,10 +402,15 @@ export function CalendarWeek({
// see the --c-leave-* tokens) and owner by a 2px left cap
// (`--self`/`--partner`) — never by hue, so the two axes stay
// readable side by side and in greyscale.
+ const typeKey = getTypeKey(representativeType)
const classNames = [
'calendar-band',
- `calendar-band--${getTypeKey(representativeType)}`,
+ `calendar-band--${typeKey}`,
+ // `leave-swatch--*` (primitives.css) carries the shared
+ // fill/hatch/outline/cap-mark recipe; `unknown` has no recipe.
+ typeKey !== 'unknown' ? `leave-swatch--${typeKey}` : '',
segment.parentUuid === personalDataUuid ? 'calendar-band--self' : 'calendar-band--partner',
+ segment.parentUuid === personalDataUuid ? 'leave-swatch--cap-self' : 'leave-swatch--cap-partner',
segment.isBandStart ? 'calendar-band--start' : '',
segment.isBandEnd ? 'calendar-band--end' : '',
segment.wishId && segment.wishId === flashWishId ? 'calendar-band--flash' : '',
diff --git a/frontend/src/components/common/TipCardShell.test.tsx b/frontend/src/components/common/TipCardShell.test.tsx
new file mode 100644
index 0000000..935e17f
--- /dev/null
+++ b/frontend/src/components/common/TipCardShell.test.tsx
@@ -0,0 +1,114 @@
+import { describe, it, expect, vi } from 'vitest'
+import { render, screen, fireEvent } from '@testing-library/react'
+import { TipCardShell } from './TipCardShell'
+
+describe('TipCardShell', () => {
+ it.each([
+ ['info', 'tip-card--info'],
+ ['warning', 'tip-card--warning'],
+ ['action', 'tip-card--action'],
+ ['danger', 'tip-card--danger'],
+ ] as const)('renders the %s variant with role="article" and the matching class', (variant, cls) => {
+ render(
+
+
Body
+ ,
+ )
+ const el = screen.getByRole('article')
+ expect(el).toHaveClass('tip-card', cls)
+ })
+
+ it('renders the title in a tip-card__title heading and the children below the header', () => {
+ render(
+
+
My body
+ ,
+ )
+ const el = screen.getByRole('article')
+ expect(el.querySelector('.tip-card__title')?.textContent).toBe('My title')
+ expect(el.querySelector('.tip-card__body')?.textContent).toBe('My body')
+ })
+
+ it('renders without a data-testid when none is given', () => {
+ render(
+
+