@f-ewald/components 1.27.2 → 1.28.0
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/custom-elements.json +109 -9
- package/dist/calendar-day.d.ts +21 -0
- package/dist/calendar-day.d.ts.map +1 -1
- package/dist/calendar-day.js +131 -9
- package/dist/calendar-day.js.map +1 -1
- package/dist/calendar-entry.d.ts +1 -0
- package/dist/calendar-entry.d.ts.map +1 -1
- package/dist/calendar-entry.js +2 -1
- package/dist/calendar-entry.js.map +1 -1
- package/dist/calendar-month.d.ts +3 -3
- package/dist/calendar-month.d.ts.map +1 -1
- package/dist/calendar-month.js +40 -7
- package/dist/calendar-month.js.map +1 -1
- package/dist/calendar-week.d.ts.map +1 -1
- package/dist/calendar-week.js +30 -3
- package/dist/calendar-week.js.map +1 -1
- package/dist/icons.d.ts +1 -1
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +1 -1
- package/dist/icons.js.map +1 -1
- package/dist/percent-bar-chart.d.ts.map +1 -1
- package/dist/percent-bar-chart.js +9 -2
- package/dist/percent-bar-chart.js.map +1 -1
- package/dist/radio-cards.d.ts +5 -1
- package/dist/radio-cards.d.ts.map +1 -1
- package/dist/radio-cards.js +19 -2
- package/dist/radio-cards.js.map +1 -1
- package/dist/scroll-to-bottom.d.ts +6 -0
- package/dist/scroll-to-bottom.d.ts.map +1 -1
- package/dist/scroll-to-bottom.js +31 -7
- package/dist/scroll-to-bottom.js.map +1 -1
- package/dist/scroll-to-top.d.ts +6 -0
- package/dist/scroll-to-top.d.ts.map +1 -1
- package/dist/scroll-to-top.js +31 -7
- package/dist/scroll-to-top.js.map +1 -1
- package/dist/tokens.css +4 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +11 -0
- package/dist/tokens.js.map +1 -1
- package/dist/ui-button.d.ts +24 -0
- package/dist/ui-button.d.ts.map +1 -1
- package/dist/ui-button.js +122 -1
- package/dist/ui-button.js.map +1 -1
- package/dist/utils/calendar.d.ts +1 -0
- package/dist/utils/calendar.d.ts.map +1 -1
- package/dist/utils/calendar.js +2 -0
- package/dist/utils/calendar.js.map +1 -1
- package/dist/weight-bar-chart.js +2 -2
- package/dist/weight-bar-chart.js.map +1 -1
- package/docs/calendar-day.md +7 -1
- package/docs/calendar-entry.md +2 -0
- package/docs/calendar-month.md +3 -0
- package/docs/calendar-week.md +5 -1
- package/docs/design-language.md +19 -0
- package/docs/icons.md +1 -1
- package/docs/radio-cards.md +6 -1
- package/docs/scroll-to-bottom.md +15 -0
- package/docs/scroll-to-top.md +15 -0
- package/docs/ui-button.md +28 -0
- package/docs/weight-bar-chart.md +1 -0
- package/llms.txt +59 -13
- package/package.json +1 -1
package/dist/utils/calendar.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/utils/calendar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,eAAe,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,6EAA6E;AAC7E,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;CACf;AAED,6EAA6E;AAC7E,MAAM,WAAW,UAAW,SAAQ,qBAAqB;IACvD,IAAI,EAAE,MAAM,CAAC;CACd;AAKD,uEAAuE;AACvE,eAAO,MAAM,yBAAyB,UAAqD,CAAC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,IAAI,EAAE,IAAI,GAAG,IAAI,CAE5C;AAED,gGAAgG;AAChG,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAEvD;AAED,wGAAwG;AACxG,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAoBzD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,2EAA2E;IAC3E,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,IAAI,CAoBpF"}
|
package/dist/utils/calendar.js
CHANGED
|
@@ -59,12 +59,14 @@ function slottedText(el, slotName) {
|
|
|
59
59
|
export function readCalendarEntryElement(el) {
|
|
60
60
|
const title = slottedText(el, "title").find((line) => line.length > 0);
|
|
61
61
|
const footer = slottedText(el, "footer").find((line) => line.length > 0);
|
|
62
|
+
const location = slottedText(el, "location").find((line) => line.length > 0);
|
|
62
63
|
return {
|
|
63
64
|
start: el.start,
|
|
64
65
|
end: el.end,
|
|
65
66
|
label: title ?? el.label,
|
|
66
67
|
details: slottedText(el, "detail"),
|
|
67
68
|
footer,
|
|
69
|
+
location,
|
|
68
70
|
color: el.color,
|
|
69
71
|
href: el.href,
|
|
70
72
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../src/utils/calendar.ts"],"names":[],"mappings":"AAyBA,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AACrD,MAAM,oBAAoB,GAAG,2CAA2C,CAAC;AAEzE,uEAAuE;AACvE,MAAM,CAAC,MAAM,yBAAyB,G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AAC,CAAC,SAAS,CAAC;IACtF,CAAC;IAED,OAAO;QACL,GAAG,IAAI;QACP,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;QAC3B,SAAS;QACT,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;QAClD,MAAM;KACP,CAAC;AACJ,CAAC","sourcesContent":["import type { StatusPillColor } from \"../status-pill.js\";\nimport type { CalendarEntry } from \"../calendar-entry.js\";\n\n/** Plain data extracted from a `calendar-entry` element's properties. */\nexport interface CalendarEntryData {\n start: string;\n end: string;\n label: string;\n details?: string[];\n footer?: string;\n color: StatusPillColor;\n href?: string;\n}\n\n/** A `CalendarEntryData` with its date strings resolved to local `Date`s. */\nexport interface ResolvedCalendarEntry extends CalendarEntryData {\n startDate: Date;\n endDate: Date;\n}\n\n/** A `ResolvedCalendarEntry` assigned a stacking column by `assignLanes`. */\nexport interface LanedEntry extends ResolvedCalendarEntry {\n lane: number;\n}\n\nconst ISO_DATE_PATTERN = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nconst ISO_DATETIME_PATTERN = /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2})$/;\n\n/** Attributes whose mutations can change a rendered calendar entry. */\nexport const CALENDAR_ENTRY_ATTRIBUTES = [\"start\", \"end\", \"label\", \"color\", \"href\", \"slot\"];\n\n/** Number of days in `month` (1-12) of `year`, leap years included. */\nexport function daysInMonth(year: number, month: number): number {\n return new Date(year, month, 0).getDate();\n}\n\n/**\n * Parses `\"YYYY-MM-DD\"` as a local-midnight `Date`. Returns `null` for\n * anything that doesn't match or doesn't round-trip (e.g. \"2026-02-30\") —\n * deliberately never uses `new Date(iso)`/`.toISOString()`, both of which\n * are UTC-based and would silently shift the date in negative-UTC-offset\n * timezones.\n */\nexport function parseIsoDate(iso: string): Date | null {\n const match = ISO_DATE_PATTERN.exec(iso);\n if (!match) return null;\n\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n const date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n return null;\n }\n return date;\n}\n\n/** Formats a `Date`'s local year/month/day as `\"YYYY-MM-DD\"`. */\nexport function toIsoDate(date: Date): string {\n const year = String(date.getFullYear()).padStart(4, \"0\");\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\n\nconst monthNameFormatter = new Intl.DateTimeFormat(undefined, { month: \"long\" });\n\n/** Locale-aware full month name for `month` (1-12). */\nexport function monthName(month: number): string {\n return monthNameFormatter.format(new Date(2000, month - 1, 1));\n}\n\n/** Sunday-first weekday abbreviations, indexed by `Date.getDay()` (0 = Sunday). */\nexport const WEEKDAY_ABBR: readonly string[] = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n\n/**\n * Whether `date` falls on a Saturday or Sunday, per JS's `Date.getDay()`\n * convention (Sunday = 0 .. Saturday = 6) — note this differs from Python's\n * `calendar` module (Monday = 0), which the original reference\n * implementation this component's layout is based on used.\n */\nexport function isWeekend(date: Date): boolean {\n const day = date.getDay();\n return day === 0 || day === 6;\n}\n\n/** Reads normalized plain-text content from direct children assigned to a named slot. */\nfunction slottedText(el: CalendarEntry, slotName: string): string[] {\n return Array.from(el.querySelectorAll<HTMLElement>(`:scope > [slot=\"${slotName}\"]`))\n .map((node) => (node.textContent ?? \"\").replace(/\\s+/g, \" \").trim());\n}\n\n/** Reads a `calendar-entry` element's properties and named text slots into plain data. */\nexport function readCalendarEntryElement(el: CalendarEntry): CalendarEntryData {\n const title = slottedText(el, \"title\").find((line) => line.length > 0);\n const footer = slottedText(el, \"footer\").find((line) => line.length > 0);\n return {\n start: el.start,\n end: el.end,\n label: title ?? el.label,\n details: slottedText(el, \"detail\"),\n footer,\n color: el.color,\n href: el.href,\n };\n}\n\n/**\n * Resolves a `CalendarEntryData`'s date strings to `Date`s. Returns `null`\n * when `start` is missing or unparseable — such entries are dropped\n * silently rather than thrown, since this reads declarative markup a\n * consumer authored, not validated user input. A blank `end` defaults to\n * `start` (single-day entry); an `end` before `start` is clamped up to\n * `start` rather than treated as an error.\n */\nexport function resolveEntry(data: CalendarEntryData): ResolvedCalendarEntry | null {\n const startDate = parseIsoDate(data.start);\n if (!startDate) return null;\n\n const endDate = parseIsoDate(data.end) ?? startDate;\n return {\n ...data,\n details: data.details ?? [],\n startDate,\n endDate: endDate < startDate ? startDate : endDate,\n };\n}\n\n/** Whether `entry`'s inclusive date range intersects the inclusive `[rangeStart, rangeEnd]` range. */\nexport function overlapsRange(entry: ResolvedCalendarEntry, rangeStart: Date, rangeEnd: Date): boolean {\n return entry.startDate <= rangeEnd && entry.endDate >= rangeStart;\n}\n\n/**\n * Assigns each entry a 0-based stacking lane via greedy interval\n * partitioning (\"meeting rooms II\"): entries are sorted by start date, then\n * each is placed in the lowest-numbered lane whose current occupant ends\n * strictly before the entry starts. Because entry ranges are\n * inclusive-inclusive, an entry ending on day X and one starting on day X\n * both occupy day X and must not share a lane — hence the strict `<`.\n *\n * Lane assignment is meant to be computed independently per `calendar-month`\n * (from only the entries overlapping that month); an entry spanning a month\n * boundary may therefore land in a different lane in adjacent months. This\n * is an accepted v1 limitation, not a bug.\n */\nexport function assignLanes(entries: ResolvedCalendarEntry[]): {\n entries: LanedEntry[];\n laneCount: number;\n} {\n const sorted = entries\n .map((entry, index) => ({ entry, index }))\n .sort((a, b) => {\n const startDiff = a.entry.startDate.getTime() - b.entry.startDate.getTime();\n if (startDiff !== 0) return startDiff;\n const endDiff = a.entry.endDate.getTime() - b.entry.endDate.getTime();\n if (endDiff !== 0) return endDiff;\n return a.index - b.index;\n });\n\n const laneEnds: Date[] = [];\n const laned: LanedEntry[] = [];\n for (const { entry } of sorted) {\n let lane = laneEnds.findIndex((end) => end < entry.startDate);\n if (lane === -1) {\n lane = laneEnds.length;\n laneEnds.push(entry.endDate);\n } else {\n laneEnds[lane] = entry.endDate;\n }\n laned.push({ ...entry, lane });\n }\n\n return { entries: laned, laneCount: laneEnds.length };\n}\n\n/** Adds `days` (negative to subtract) to `date`, returning a new local `Date`. */\nexport function addDays(date: Date, days: number): Date {\n const result = new Date(date);\n result.setDate(result.getDate() + days);\n return result;\n}\n\n/** The Sunday (local midnight) of the week containing `date`, per `WEEKDAY_ABBR`'s Sunday-first convention. */\nexport function startOfWeek(date: Date): Date {\n return addDays(date, -date.getDay());\n}\n\n/** Minutes elapsed since local midnight on `date`'s day, for hour-grid vertical positioning. */\nexport function minutesSinceMidnight(date: Date): number {\n return date.getHours() * 60 + date.getMinutes();\n}\n\n/** Whether `iso` carries a time-of-day component (`\"YYYY-MM-DDTHH:MM\"`) rather than being date-only. */\nexport function hasTimeComponent(iso: string): boolean {\n return ISO_DATETIME_PATTERN.test(iso);\n}\n\n/**\n * Parses `\"YYYY-MM-DDTHH:MM\"` as a local `Date`, falling back to\n * `parseIsoDate` (local midnight) for a plain `\"YYYY-MM-DD\"` string. Returns\n * `null` for anything else, including a datetime whose components don't\n * round-trip (e.g. an invalid hour).\n */\nexport function parseIsoDateTime(iso: string): Date | null {\n const match = ISO_DATETIME_PATTERN.exec(iso);\n if (!match) return parseIsoDate(iso);\n\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n const hours = Number(match[4]);\n const minutes = Number(match[5]);\n const date = new Date(year, month - 1, day, hours, minutes);\n if (\n date.getFullYear() !== year ||\n date.getMonth() !== month - 1 ||\n date.getDate() !== day ||\n date.getHours() !== hours ||\n date.getMinutes() !== minutes\n ) {\n return null;\n }\n return date;\n}\n\n/**\n * A `CalendarEntryData` resolved for hour-grid (`calendar-day`/`calendar-week`)\n * rendering. Reuses the `startDate`/`endDate` field names from\n * `ResolvedCalendarEntry` so it stays structurally compatible with\n * `assignLanes`/`overlapsRange` — both operate purely on those two `Date`\n * fields via `.getTime()`, which already generalizes correctly to sub-day\n * time granularity and multi-day ranges with no changes needed.\n */\nexport interface ResolvedTimedEntry extends CalendarEntryData {\n startDate: Date;\n endDate: Date;\n /** True when neither `start` nor `end` carries a time-of-day component. */\n allDay: boolean;\n}\n\n/**\n * Resolves a `CalendarEntryData`'s date/datetime strings for hour-grid\n * rendering. Returns `null` when `start` is missing or unparseable. A blank\n * `end` defaults to `start`; when `start` has a time but `end` doesn't (or is\n * blank), `end` defaults to one hour after `start` rather than clamping to\n * `start`'s instant, so a timed entry with no explicit end still renders as\n * a visible block. `allDay` is true only when neither endpoint carries a\n * time-of-day component — this is a separate, additive resolution path from\n * `resolveEntry`/`ResolvedCalendarEntry`, which stay date-only and are used\n * unchanged by `calendar-month`/`calendar-year`.\n */\nexport function resolveTimedEntry(data: CalendarEntryData): ResolvedTimedEntry | null {\n const startDate = parseIsoDateTime(data.start);\n if (!startDate) return null;\n\n const startHasTime = hasTimeComponent(data.start);\n const endHasTime = hasTimeComponent(data.end);\n const allDay = !startHasTime && !endHasTime;\n\n let endDate = data.end ? parseIsoDateTime(data.end) : null;\n if (!endDate) {\n endDate = startHasTime ? new Date(startDate.getTime() + 60 * 60 * 1000) : startDate;\n }\n\n return {\n ...data,\n details: data.details ?? [],\n startDate,\n endDate: endDate < startDate ? startDate : endDate,\n allDay,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../src/utils/calendar.ts"],"names":[],"mappings":"AA0BA,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AACrD,MAAM,oBAAoB,GAAG,2CAA2C,CAAC;AAEzE,uEAAuE;AACvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE5F,uEAAuE;AACvE,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,KAAa;IACrD,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,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L,GAAG,IAAI;QACP,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;QAC3B,SAAS;QACT,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;QAClD,MAAM;KACP,CAAC;AACJ,CAAC","sourcesContent":["import type { StatusPillColor } from \"../status-pill.js\";\nimport type { CalendarEntry } from \"../calendar-entry.js\";\n\n/** Plain data extracted from a `calendar-entry` element's properties. */\nexport interface CalendarEntryData {\n start: string;\n end: string;\n label: string;\n details?: string[];\n footer?: string;\n location?: string;\n color: StatusPillColor;\n href?: string;\n}\n\n/** A `CalendarEntryData` with its date strings resolved to local `Date`s. */\nexport interface ResolvedCalendarEntry extends CalendarEntryData {\n startDate: Date;\n endDate: Date;\n}\n\n/** A `ResolvedCalendarEntry` assigned a stacking column by `assignLanes`. */\nexport interface LanedEntry extends ResolvedCalendarEntry {\n lane: number;\n}\n\nconst ISO_DATE_PATTERN = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nconst ISO_DATETIME_PATTERN = /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2})$/;\n\n/** Attributes whose mutations can change a rendered calendar entry. */\nexport const CALENDAR_ENTRY_ATTRIBUTES = [\"start\", \"end\", \"label\", \"color\", \"href\", \"slot\"];\n\n/** Number of days in `month` (1-12) of `year`, leap years included. */\nexport function daysInMonth(year: number, month: number): number {\n return new Date(year, month, 0).getDate();\n}\n\n/**\n * Parses `\"YYYY-MM-DD\"` as a local-midnight `Date`. Returns `null` for\n * anything that doesn't match or doesn't round-trip (e.g. \"2026-02-30\") —\n * deliberately never uses `new Date(iso)`/`.toISOString()`, both of which\n * are UTC-based and would silently shift the date in negative-UTC-offset\n * timezones.\n */\nexport function parseIsoDate(iso: string): Date | null {\n const match = ISO_DATE_PATTERN.exec(iso);\n if (!match) return null;\n\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n const date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n return null;\n }\n return date;\n}\n\n/** Formats a `Date`'s local year/month/day as `\"YYYY-MM-DD\"`. */\nexport function toIsoDate(date: Date): string {\n const year = String(date.getFullYear()).padStart(4, \"0\");\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\n\nconst monthNameFormatter = new Intl.DateTimeFormat(undefined, { month: \"long\" });\n\n/** Locale-aware full month name for `month` (1-12). */\nexport function monthName(month: number): string {\n return monthNameFormatter.format(new Date(2000, month - 1, 1));\n}\n\n/** Sunday-first weekday abbreviations, indexed by `Date.getDay()` (0 = Sunday). */\nexport const WEEKDAY_ABBR: readonly string[] = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n\n/**\n * Whether `date` falls on a Saturday or Sunday, per JS's `Date.getDay()`\n * convention (Sunday = 0 .. Saturday = 6) — note this differs from Python's\n * `calendar` module (Monday = 0), which the original reference\n * implementation this component's layout is based on used.\n */\nexport function isWeekend(date: Date): boolean {\n const day = date.getDay();\n return day === 0 || day === 6;\n}\n\n/** Reads normalized plain-text content from direct children assigned to a named slot. */\nfunction slottedText(el: CalendarEntry, slotName: string): string[] {\n return Array.from(el.querySelectorAll<HTMLElement>(`:scope > [slot=\"${slotName}\"]`))\n .map((node) => (node.textContent ?? \"\").replace(/\\s+/g, \" \").trim());\n}\n\n/** Reads a `calendar-entry` element's properties and named text slots into plain data. */\nexport function readCalendarEntryElement(el: CalendarEntry): CalendarEntryData {\n const title = slottedText(el, \"title\").find((line) => line.length > 0);\n const footer = slottedText(el, \"footer\").find((line) => line.length > 0);\n const location = slottedText(el, \"location\").find((line) => line.length > 0);\n return {\n start: el.start,\n end: el.end,\n label: title ?? el.label,\n details: slottedText(el, \"detail\"),\n footer,\n location,\n color: el.color,\n href: el.href,\n };\n}\n\n/**\n * Resolves a `CalendarEntryData`'s date strings to `Date`s. Returns `null`\n * when `start` is missing or unparseable — such entries are dropped\n * silently rather than thrown, since this reads declarative markup a\n * consumer authored, not validated user input. A blank `end` defaults to\n * `start` (single-day entry); an `end` before `start` is clamped up to\n * `start` rather than treated as an error.\n */\nexport function resolveEntry(data: CalendarEntryData): ResolvedCalendarEntry | null {\n const startDate = parseIsoDate(data.start);\n if (!startDate) return null;\n\n const endDate = parseIsoDate(data.end) ?? startDate;\n return {\n ...data,\n details: data.details ?? [],\n startDate,\n endDate: endDate < startDate ? startDate : endDate,\n };\n}\n\n/** Whether `entry`'s inclusive date range intersects the inclusive `[rangeStart, rangeEnd]` range. */\nexport function overlapsRange(entry: ResolvedCalendarEntry, rangeStart: Date, rangeEnd: Date): boolean {\n return entry.startDate <= rangeEnd && entry.endDate >= rangeStart;\n}\n\n/**\n * Assigns each entry a 0-based stacking lane via greedy interval\n * partitioning (\"meeting rooms II\"): entries are sorted by start date, then\n * each is placed in the lowest-numbered lane whose current occupant ends\n * strictly before the entry starts. Because entry ranges are\n * inclusive-inclusive, an entry ending on day X and one starting on day X\n * both occupy day X and must not share a lane — hence the strict `<`.\n *\n * Lane assignment is meant to be computed independently per `calendar-month`\n * (from only the entries overlapping that month); an entry spanning a month\n * boundary may therefore land in a different lane in adjacent months. This\n * is an accepted v1 limitation, not a bug.\n */\nexport function assignLanes(entries: ResolvedCalendarEntry[]): {\n entries: LanedEntry[];\n laneCount: number;\n} {\n const sorted = entries\n .map((entry, index) => ({ entry, index }))\n .sort((a, b) => {\n const startDiff = a.entry.startDate.getTime() - b.entry.startDate.getTime();\n if (startDiff !== 0) return startDiff;\n const endDiff = a.entry.endDate.getTime() - b.entry.endDate.getTime();\n if (endDiff !== 0) return endDiff;\n return a.index - b.index;\n });\n\n const laneEnds: Date[] = [];\n const laned: LanedEntry[] = [];\n for (const { entry } of sorted) {\n let lane = laneEnds.findIndex((end) => end < entry.startDate);\n if (lane === -1) {\n lane = laneEnds.length;\n laneEnds.push(entry.endDate);\n } else {\n laneEnds[lane] = entry.endDate;\n }\n laned.push({ ...entry, lane });\n }\n\n return { entries: laned, laneCount: laneEnds.length };\n}\n\n/** Adds `days` (negative to subtract) to `date`, returning a new local `Date`. */\nexport function addDays(date: Date, days: number): Date {\n const result = new Date(date);\n result.setDate(result.getDate() + days);\n return result;\n}\n\n/** The Sunday (local midnight) of the week containing `date`, per `WEEKDAY_ABBR`'s Sunday-first convention. */\nexport function startOfWeek(date: Date): Date {\n return addDays(date, -date.getDay());\n}\n\n/** Minutes elapsed since local midnight on `date`'s day, for hour-grid vertical positioning. */\nexport function minutesSinceMidnight(date: Date): number {\n return date.getHours() * 60 + date.getMinutes();\n}\n\n/** Whether `iso` carries a time-of-day component (`\"YYYY-MM-DDTHH:MM\"`) rather than being date-only. */\nexport function hasTimeComponent(iso: string): boolean {\n return ISO_DATETIME_PATTERN.test(iso);\n}\n\n/**\n * Parses `\"YYYY-MM-DDTHH:MM\"` as a local `Date`, falling back to\n * `parseIsoDate` (local midnight) for a plain `\"YYYY-MM-DD\"` string. Returns\n * `null` for anything else, including a datetime whose components don't\n * round-trip (e.g. an invalid hour).\n */\nexport function parseIsoDateTime(iso: string): Date | null {\n const match = ISO_DATETIME_PATTERN.exec(iso);\n if (!match) return parseIsoDate(iso);\n\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n const hours = Number(match[4]);\n const minutes = Number(match[5]);\n const date = new Date(year, month - 1, day, hours, minutes);\n if (\n date.getFullYear() !== year ||\n date.getMonth() !== month - 1 ||\n date.getDate() !== day ||\n date.getHours() !== hours ||\n date.getMinutes() !== minutes\n ) {\n return null;\n }\n return date;\n}\n\n/**\n * A `CalendarEntryData` resolved for hour-grid (`calendar-day`/`calendar-week`)\n * rendering. Reuses the `startDate`/`endDate` field names from\n * `ResolvedCalendarEntry` so it stays structurally compatible with\n * `assignLanes`/`overlapsRange` — both operate purely on those two `Date`\n * fields via `.getTime()`, which already generalizes correctly to sub-day\n * time granularity and multi-day ranges with no changes needed.\n */\nexport interface ResolvedTimedEntry extends CalendarEntryData {\n startDate: Date;\n endDate: Date;\n /** True when neither `start` nor `end` carries a time-of-day component. */\n allDay: boolean;\n}\n\n/**\n * Resolves a `CalendarEntryData`'s date/datetime strings for hour-grid\n * rendering. Returns `null` when `start` is missing or unparseable. A blank\n * `end` defaults to `start`; when `start` has a time but `end` doesn't (or is\n * blank), `end` defaults to one hour after `start` rather than clamping to\n * `start`'s instant, so a timed entry with no explicit end still renders as\n * a visible block. `allDay` is true only when neither endpoint carries a\n * time-of-day component — this is a separate, additive resolution path from\n * `resolveEntry`/`ResolvedCalendarEntry`, which stay date-only and are used\n * unchanged by `calendar-month`/`calendar-year`.\n */\nexport function resolveTimedEntry(data: CalendarEntryData): ResolvedTimedEntry | null {\n const startDate = parseIsoDateTime(data.start);\n if (!startDate) return null;\n\n const startHasTime = hasTimeComponent(data.start);\n const endHasTime = hasTimeComponent(data.end);\n const allDay = !startHasTime && !endHasTime;\n\n let endDate = data.end ? parseIsoDateTime(data.end) : null;\n if (!endDate) {\n endDate = startHasTime ? new Date(startDate.getTime() + 60 * 60 * 1000) : startDate;\n }\n\n return {\n ...data,\n details: data.details ?? [],\n startDate,\n endDate: endDate < startDate ? startDate : endDate,\n allDay,\n };\n}\n"]}
|
package/dist/weight-bar-chart.js
CHANGED
|
@@ -55,7 +55,7 @@ let WeightBarChart = class WeightBarChart extends LitElement {
|
|
|
55
55
|
flex: 1 1 auto;
|
|
56
56
|
height: 0.75rem;
|
|
57
57
|
background: var(--ui-surface-muted, #f8fafc);
|
|
58
|
-
border-radius:
|
|
58
|
+
border-radius: var(--ui-radius-sm, 0.25rem);
|
|
59
59
|
overflow: hidden;
|
|
60
60
|
}
|
|
61
61
|
.bar {
|
|
@@ -66,7 +66,7 @@ let WeightBarChart = class WeightBarChart extends LitElement {
|
|
|
66
66
|
color-mix(in srgb, var(--ui-primary, #4f46e5) 70%, #ffffff) 0%,
|
|
67
67
|
color-mix(in srgb, var(--ui-primary, #4f46e5) 70%, #000000) 100%
|
|
68
68
|
);
|
|
69
|
-
border-radius: 0
|
|
69
|
+
border-radius: 0 var(--ui-radius-sm, 0.25rem) var(--ui-radius-sm, 0.25rem) 0;
|
|
70
70
|
transition: width 150ms ease-out;
|
|
71
71
|
}
|
|
72
72
|
.pct {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weight-bar-chart.js","sourceRoot":"","sources":["../src/weight-bar-chart.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC;;;;;;;;;GASG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAAvC;;QACL,oEAAoE;QACpC,UAAK,GAAoB,EAAE,CAAC;IAsF9D,CAAC;aApFiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuDF;KACF,AA1DqB,CA0DpB;IAEO,MAAM;QACb,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACzC,+EAA+E;QAC/E,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QACjE,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAChE,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClG,OAAO,IAAI,CAAA;6CAC8B,OAAO;UAC1C,MAAM,CACN,MAAM,EACN,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EACjB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;oCAEY,IAAI,CAAC,KAAK;;iDAEG,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG;;kCAEvC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;;WAEnD,CACF;;KAEJ,CAAC;IACJ,CAAC;CACF,CAAA;AAtFiC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6CAA6B;AAFjD,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAwF1B","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { tokens } from \"./tokens.js\";\n\nexport interface WeightBarItem {\n id: string;\n label: string;\n /** Normalized fraction (fractions across all items sum to ~1). */\n value: number;\n}\n\n/**\n * Sorted horizontal bar chart of labeled weights (normalized fractions\n * summing to ~1). Bars sort descending — the order IS the priority ranking.\n * Widths scale relative to the largest weight (which fills its track); the\n * percent labels carry the absolute values. Rows are keyed by item id\n * (repeat directive) so a re-render with new weights moves the existing\n * rows; bar widths animate via CSS, re-sorting is instant.\n *\n * @element weight-bar-chart\n */\n@customElement(\"weight-bar-chart\")\nexport class WeightBarChart extends LitElement {\n /** Items to render as weighted rows, sorted descending by value. */\n @property({ attribute: false }) items: WeightBarItem[] = [];\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .row {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin: 0.5rem 0;\n }\n .label {\n flex: 0 0 5.5rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n color: var(--ui-text, #0f172a);\n }\n .track {\n flex: 1 1 auto;\n height: 0.75rem;\n background: var(--ui-surface-muted, #f8fafc);\n border-radius:
|
|
1
|
+
{"version":3,"file":"weight-bar-chart.js","sourceRoot":"","sources":["../src/weight-bar-chart.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC;;;;;;;;;GASG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAAvC;;QACL,oEAAoE;QACpC,UAAK,GAAoB,EAAE,CAAC;IAsF9D,CAAC;aApFiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuDF;KACF,AA1DqB,CA0DpB;IAEO,MAAM;QACb,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACzC,+EAA+E;QAC/E,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QACjE,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAChE,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClG,OAAO,IAAI,CAAA;6CAC8B,OAAO;UAC1C,MAAM,CACN,MAAM,EACN,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EACjB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;oCAEY,IAAI,CAAC,KAAK;;iDAEG,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG;;kCAEvC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;;WAEnD,CACF;;KAEJ,CAAC;IACJ,CAAC;CACF,CAAA;AAtFiC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6CAA6B;AAFjD,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAwF1B","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { tokens } from \"./tokens.js\";\n\nexport interface WeightBarItem {\n id: string;\n label: string;\n /** Normalized fraction (fractions across all items sum to ~1). */\n value: number;\n}\n\n/**\n * Sorted horizontal bar chart of labeled weights (normalized fractions\n * summing to ~1). Bars sort descending — the order IS the priority ranking.\n * Widths scale relative to the largest weight (which fills its track); the\n * percent labels carry the absolute values. Rows are keyed by item id\n * (repeat directive) so a re-render with new weights moves the existing\n * rows; bar widths animate via CSS, re-sorting is instant.\n *\n * @element weight-bar-chart\n */\n@customElement(\"weight-bar-chart\")\nexport class WeightBarChart extends LitElement {\n /** Items to render as weighted rows, sorted descending by value. */\n @property({ attribute: false }) items: WeightBarItem[] = [];\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .row {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin: 0.5rem 0;\n }\n .label {\n flex: 0 0 5.5rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n color: var(--ui-text, #0f172a);\n }\n .track {\n flex: 1 1 auto;\n height: 0.75rem;\n background: var(--ui-surface-muted, #f8fafc);\n border-radius: var(--ui-radius-sm, 0.25rem);\n overflow: hidden;\n }\n .bar {\n height: 100%;\n /* Match map-circle's 30% white/black vertical depth while preserving token overrides. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--ui-primary, #4f46e5) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--ui-primary, #4f46e5) 70%, #000000) 100%\n );\n border-radius: 0 var(--ui-radius-sm, 0.25rem) var(--ui-radius-sm, 0.25rem) 0;\n transition: width 150ms ease-out;\n }\n .pct {\n flex: 0 0 2.5rem;\n text-align: right;\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-variant-numeric: tabular-nums;\n color: var(--ui-text-muted, #64748b);\n }\n @media (prefers-reduced-motion: reduce) {\n .bar {\n transition: none;\n }\n }\n `,\n ];\n\n override render() {\n if (this.items.length === 0) return null;\n // Stable sort: ties keep the incoming item order, so the chart never flickers.\n const sorted = [...this.items].sort((a, b) => b.value - a.value);\n const max = Math.max(0.01, ...sorted.map((item) => item.value));\n const summary = sorted.map((item) => `${item.label} ${Math.round(item.value * 100)}%`).join(\", \");\n return html`\n <div role=\"img\" aria-label=\"Weights: ${summary}\">\n ${repeat(\n sorted,\n (item) => item.id,\n (item) => html`\n <div class=\"row\">\n <span class=\"label\">${item.label}</span>\n <div class=\"track\">\n <div class=\"bar\" style=\"width: ${(item.value / max) * 100}%\"></div>\n </div>\n <span class=\"pct\">${Math.round(item.value * 100)}%</span>\n </div>\n `,\n )}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"weight-bar-chart\": WeightBarChart;\n }\n}\n"]}
|
package/docs/calendar-day.md
CHANGED
|
@@ -21,11 +21,12 @@ import "@f-ewald/components/calendar-day.js";
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
23
|
```html
|
|
24
|
-
<calendar-day date="2026-07-15">
|
|
24
|
+
<calendar-day date="2026-07-15" time-marker>
|
|
25
25
|
<calendar-entry start="2026-07-15" end="2026-07-15" label="Company holiday" color="neutral"></calendar-entry>
|
|
26
26
|
<calendar-entry start="2026-07-15T09:00" end="2026-07-15T09:30" label="Standup" color="info"></calendar-entry>
|
|
27
27
|
<calendar-entry start="2026-07-15T09:15" end="2026-07-15T10:00" label="Design review" color="primary" href="#review">
|
|
28
28
|
<span slot="detail">Walk through the new onboarding flow</span>
|
|
29
|
+
<span slot="location">Room A</span>
|
|
29
30
|
</calendar-entry>
|
|
30
31
|
</calendar-day>
|
|
31
32
|
```
|
|
@@ -35,6 +36,8 @@ import "@f-ewald/components/calendar-day.js";
|
|
|
35
36
|
| Property | Attribute | Type | Default | Description |
|
|
36
37
|
| --- | --- | --- | --- | --- |
|
|
37
38
|
| `date` | `date` | `string` | `—` | The day shown, `"YYYY-MM-DD"`. |
|
|
39
|
+
| `timeMarker` | `time-marker` | `boolean` | `false` | Shows a fine live line marking the current time, Google-Calendar-style. Only rendered when `date` is today. |
|
|
40
|
+
| `minWidth` | `min-width` | `string` | `""` | Minimum width for the day column, as a CSS length (e.g. `"18rem"`). Unset leaves the host's width fully controlled by its container — useful as the sizing floor when placing several `calendar-day` elements in a scrollable row. |
|
|
38
41
|
|
|
39
42
|
## Events
|
|
40
43
|
|
|
@@ -57,7 +60,9 @@ _None._
|
|
|
57
60
|
| `--ui-font` |
|
|
58
61
|
| `--ui-font-size-lg` |
|
|
59
62
|
| `--ui-font-size-sm` |
|
|
63
|
+
| `--ui-font-size-xs` |
|
|
60
64
|
| `--ui-font-weight-medium` |
|
|
65
|
+
| `--ui-font-weight-regular` |
|
|
61
66
|
| `--ui-font-weight-semibold` |
|
|
62
67
|
| `--ui-hover-overlay` |
|
|
63
68
|
| `--ui-info` |
|
|
@@ -66,6 +71,7 @@ _None._
|
|
|
66
71
|
| `--ui-radius-sm` |
|
|
67
72
|
| `--ui-success` |
|
|
68
73
|
| `--ui-surface` |
|
|
74
|
+
| `--ui-surface-muted` |
|
|
69
75
|
| `--ui-text` |
|
|
70
76
|
| `--ui-text-muted` |
|
|
71
77
|
| `--ui-warning` |
|
package/docs/calendar-entry.md
CHANGED
|
@@ -20,6 +20,7 @@ import "@f-ewald/components/calendar-entry.js";
|
|
|
20
20
|
color="success"
|
|
21
21
|
>
|
|
22
22
|
<span slot="title">Vacation</span>
|
|
23
|
+
<span slot="location">Beach house</span>
|
|
23
24
|
<span slot="detail">Out of office</span>
|
|
24
25
|
<span slot="detail">Road trip along the California coast with several scenic stops</span>
|
|
25
26
|
<span slot="footer">Return July 19 at 6 PM</span>
|
|
@@ -47,6 +48,7 @@ _None._
|
|
|
47
48
|
| `title` | Plain-text title shown instead of the `label` fallback. |
|
|
48
49
|
| `detail` | Repeatable plain-text details rendered inside the shared body spanning all remaining days. |
|
|
49
50
|
| `footer` | Plain-text ending note pinned to the bottom of the shared body. |
|
|
51
|
+
| `location` | Plain-text location, shown on its own line with a leading marker icon. |
|
|
50
52
|
|
|
51
53
|
## CSS custom properties
|
|
52
54
|
|
package/docs/calendar-month.md
CHANGED
|
@@ -36,6 +36,9 @@ import "@f-ewald/components/calendar-month.js";
|
|
|
36
36
|
<span slot="detail">Talks and workshops</span>
|
|
37
37
|
<span slot="footer">Closing keynote · July 20</span>
|
|
38
38
|
</calendar-entry>
|
|
39
|
+
<calendar-entry start="2026-07-27" end="2026-07-28" label="Client lunch" color="neutral">
|
|
40
|
+
<span slot="location">Downtown bistro</span>
|
|
41
|
+
</calendar-entry>
|
|
39
42
|
</calendar-month>
|
|
40
43
|
```
|
|
41
44
|
|
package/docs/calendar-week.md
CHANGED
|
@@ -26,7 +26,9 @@ import "@f-ewald/components/calendar-week.js";
|
|
|
26
26
|
<calendar-week date="2026-07-15">
|
|
27
27
|
<calendar-entry start="2026-07-13" end="2026-07-15" label="Offsite" color="primary" href="#offsite"></calendar-entry>
|
|
28
28
|
<calendar-entry start="2026-07-14T09:00" end="2026-07-14T09:30" label="Standup" color="info"></calendar-entry>
|
|
29
|
-
<calendar-entry start="2026-07-16T14:00" end="2026-07-16T15:00" label="Customer demo" color="success"
|
|
29
|
+
<calendar-entry start="2026-07-16T14:00" end="2026-07-16T15:00" label="Customer demo" color="success">
|
|
30
|
+
<span slot="location">Main conference room</span>
|
|
31
|
+
</calendar-entry>
|
|
30
32
|
</calendar-week>
|
|
31
33
|
```
|
|
32
34
|
|
|
@@ -57,7 +59,9 @@ _None._
|
|
|
57
59
|
| `--ui-font` |
|
|
58
60
|
| `--ui-font-size-lg` |
|
|
59
61
|
| `--ui-font-size-sm` |
|
|
62
|
+
| `--ui-font-size-xs` |
|
|
60
63
|
| `--ui-font-weight-medium` |
|
|
64
|
+
| `--ui-font-weight-regular` |
|
|
61
65
|
| `--ui-font-weight-semibold` |
|
|
62
66
|
| `--ui-hover-overlay` |
|
|
63
67
|
| `--ui-info` |
|
package/docs/design-language.md
CHANGED
|
@@ -38,6 +38,19 @@ defines the details used when creating or reviewing components.
|
|
|
38
38
|
the active tab's `--ui-primary` line drawn on top of it) rather than
|
|
39
39
|
introducing a new token — the same precedent as `ui-button`'s `secondary`
|
|
40
40
|
variant, which is realized via `--ui-border`/`--ui-text-muted`, not a hue.
|
|
41
|
+
- `--ui-ai-1`…`--ui-ai-4` are the one multi-hue family: the stops of
|
|
42
|
+
`ui-button[ai]`'s animated ring, where the rainbow itself is the meaning
|
|
43
|
+
("this action is AI-powered") rather than a semantic state. They are only
|
|
44
|
+
ever used together, as a sweep around a control's edge — never as a fill,
|
|
45
|
+
text, or border color.
|
|
46
|
+
- The AI ring composes with every variant and both themes with one exception:
|
|
47
|
+
do not pair `ai` with `pill` under the gradient theme. The gradient theme
|
|
48
|
+
defines a button through a darker border edge plus a glossy top highlight,
|
|
49
|
+
and a pill's fully-rounded silhouette sits flush against the ring along its
|
|
50
|
+
whole outline, so that edge and gloss read as part of the rainbow instead
|
|
51
|
+
of the button, and the fill stops reading as a gradient. Gradient-theme AI
|
|
52
|
+
buttons keep the default `--ui-radius-sm` corners; `ai` + `pill` is a flat
|
|
53
|
+
theme combination.
|
|
41
54
|
|
|
42
55
|
## Typography
|
|
43
56
|
|
|
@@ -77,6 +90,12 @@ literal values are migrated onto them.
|
|
|
77
90
|
- Use `--ui-radius-sm` (`0.25rem` ≈ 4px) for controls, `--ui-radius`
|
|
78
91
|
(`0.5rem` ≈ 8px) for cards/dialogs/surfaces, and an intentional full
|
|
79
92
|
pill/circle radius only for pill/avatar/marker shapes.
|
|
93
|
+
- Chart bars and their tracks use `--ui-radius-sm` as well — literal `4` on
|
|
94
|
+
SVG `rx` attributes, which can't take `var()` (`percent-bar-chart`,
|
|
95
|
+
`price-history-chart`), or the token in CSS (`distribution-chart`,
|
|
96
|
+
`weight-bar-chart`). A bar is a data mark, not a pill: fully rounded ends
|
|
97
|
+
round away the value being read at short lengths. Genuine pill controls
|
|
98
|
+
(e.g. `range-slider`'s track and thumb) keep their full radius.
|
|
80
99
|
- Compact controls must retain a clear hit target and must not reserve layout
|
|
81
100
|
space for optional content that is absent.
|
|
82
101
|
|
package/docs/icons.md
CHANGED
|
@@ -63,7 +63,7 @@ const icon = iconPencil(16); // 16px, defaults shown below if omitted
|
|
|
63
63
|
| `iconQueueList` | 16px | Queues, backlogs, or ordered work-item lists. |
|
|
64
64
|
| `iconShieldCheck` | 16px | Verified, secure, or trusted states. |
|
|
65
65
|
| `iconShieldExclamation` | 16px | Security warnings, or at-risk/compromised states. |
|
|
66
|
-
| `iconSparkles` | 16px |
|
|
66
|
+
| `iconSparkles` | 16px | An AI-powered action (pairs with ui-button's `ai` ring), a gradient-theme toggle, or a decorative/enhanced visual style. |
|
|
67
67
|
| `iconSpeakerWave` | 18px | An unmuted volume control, e.g. audio-player/video-player's mute toggle. |
|
|
68
68
|
| `iconSpeakerXMark` | 18px | A muted volume state; pair with iconSpeakerWave for the unmuted state. |
|
|
69
69
|
| `iconSquares2x2` | 18px | A grid or kanban-view toggle, or to represent card/tile layouts. |
|
package/docs/radio-cards.md
CHANGED
|
@@ -10,7 +10,11 @@ The selected card's border/radio dot read `--ui-button-accent` (a solid
|
|
|
10
10
|
stand-in, since `border-color`/`accent-color` can't render a gradient),
|
|
11
11
|
and its background reads the shared `--ui-button-secondary-surface-muted`
|
|
12
12
|
plus `--ui-button-highlight`, so a gradient theme tints it consistently
|
|
13
|
-
with `button-group`/`pagination-nav`'s equivalents.
|
|
13
|
+
with `button-group`/`pagination-nav`'s equivalents. That shared value is
|
|
14
|
+
tuned for small controls, so a card — with far more area — blends it 45%
|
|
15
|
+
toward `--ui-surface` rather than taking a second token: the tint stays
|
|
16
|
+
the same hue and gradient, just lighter on light themes (and
|
|
17
|
+
correspondingly deeper on dark ones) than on a button.
|
|
14
18
|
|
|
15
19
|
## Install
|
|
16
20
|
|
|
@@ -66,6 +70,7 @@ _None._
|
|
|
66
70
|
| `--ui-font-weight-semibold` |
|
|
67
71
|
| `--ui-primary` |
|
|
68
72
|
| `--ui-radius-sm` |
|
|
73
|
+
| `--ui-surface` |
|
|
69
74
|
| `--ui-surface-muted` |
|
|
70
75
|
| `--ui-text` |
|
|
71
76
|
| `--ui-text-muted` |
|
package/docs/scroll-to-bottom.md
CHANGED
|
@@ -13,6 +13,12 @@ auto; position: relative`, so the button stays pinned to that container's
|
|
|
13
13
|
own visible corner as its content scrolls, rather than floating over the
|
|
14
14
|
whole page.
|
|
15
15
|
|
|
16
|
+
The control is styled as a standard secondary button (ui-button's
|
|
17
|
+
`secondary` variant: 2rem tall, `--ui-radius-sm` corners, the
|
|
18
|
+
`--ui-button-secondary-*` background/border tokens, so a gradient theme
|
|
19
|
+
carries over) rather than a pill, layered over an opaque `--ui-surface`
|
|
20
|
+
base and an elevation shadow, since it floats above scrolled content.
|
|
21
|
+
|
|
16
22
|
## Install
|
|
17
23
|
|
|
18
24
|
```js
|
|
@@ -57,12 +63,21 @@ _None._
|
|
|
57
63
|
| Custom property |
|
|
58
64
|
| --- |
|
|
59
65
|
| `--ui-border` |
|
|
66
|
+
| `--ui-button-highlight` |
|
|
67
|
+
| `--ui-button-secondary-` |
|
|
68
|
+
| `--ui-button-secondary-background` |
|
|
69
|
+
| `--ui-button-secondary-background-active` |
|
|
70
|
+
| `--ui-button-secondary-background-hover` |
|
|
71
|
+
| `--ui-button-secondary-border` |
|
|
72
|
+
| `--ui-button-secondary-border-hover` |
|
|
60
73
|
| `--ui-focus-ring` |
|
|
61
74
|
| `--ui-font` |
|
|
62
75
|
| `--ui-font-size-sm` |
|
|
63
76
|
| `--ui-font-weight-medium` |
|
|
64
77
|
| `--ui-line-height-tight` |
|
|
78
|
+
| `--ui-radius-sm` |
|
|
65
79
|
| `--ui-shadow` |
|
|
66
80
|
| `--ui-surface` |
|
|
67
81
|
| `--ui-surface-muted` |
|
|
68
82
|
| `--ui-text` |
|
|
83
|
+
| `--ui-text-muted` |
|
package/docs/scroll-to-top.md
CHANGED
|
@@ -13,6 +13,12 @@ auto; position: relative`, so the button stays pinned to that container's
|
|
|
13
13
|
own visible corner as its content scrolls, rather than floating over the
|
|
14
14
|
whole page.
|
|
15
15
|
|
|
16
|
+
The control is styled as a standard secondary button (ui-button's
|
|
17
|
+
`secondary` variant: 2rem tall, `--ui-radius-sm` corners, the
|
|
18
|
+
`--ui-button-secondary-*` background/border tokens, so a gradient theme
|
|
19
|
+
carries over) rather than a pill, layered over an opaque `--ui-surface`
|
|
20
|
+
base and an elevation shadow, since it floats above scrolled content.
|
|
21
|
+
|
|
16
22
|
## Install
|
|
17
23
|
|
|
18
24
|
```js
|
|
@@ -48,12 +54,21 @@ _None._
|
|
|
48
54
|
| Custom property |
|
|
49
55
|
| --- |
|
|
50
56
|
| `--ui-border` |
|
|
57
|
+
| `--ui-button-highlight` |
|
|
58
|
+
| `--ui-button-secondary-` |
|
|
59
|
+
| `--ui-button-secondary-background` |
|
|
60
|
+
| `--ui-button-secondary-background-active` |
|
|
61
|
+
| `--ui-button-secondary-background-hover` |
|
|
62
|
+
| `--ui-button-secondary-border` |
|
|
63
|
+
| `--ui-button-secondary-border-hover` |
|
|
51
64
|
| `--ui-focus-ring` |
|
|
52
65
|
| `--ui-font` |
|
|
53
66
|
| `--ui-font-size-sm` |
|
|
54
67
|
| `--ui-font-weight-medium` |
|
|
55
68
|
| `--ui-line-height-tight` |
|
|
69
|
+
| `--ui-radius-sm` |
|
|
56
70
|
| `--ui-shadow` |
|
|
57
71
|
| `--ui-surface` |
|
|
58
72
|
| `--ui-surface-muted` |
|
|
59
73
|
| `--ui-text` |
|
|
74
|
+
| `--ui-text-muted` |
|
package/docs/ui-button.md
CHANGED
|
@@ -31,6 +31,28 @@ background/border read the equivalent `--ui-button-secondary-*` tokens
|
|
|
31
31
|
transparent/bordered look, so it can be themed into a matching (e.g.
|
|
32
32
|
white-to-gray) gradient too.
|
|
33
33
|
|
|
34
|
+
`ai` is an orthogonal modifier rather than a fourth variant: it leaves the
|
|
35
|
+
variant's fill (flat or gradient-themed) untouched and only adds an
|
|
36
|
+
animated multi-hue ring *outside* the button box — a crisp masked edge
|
|
37
|
+
plus a blurred bloom behind it that fades out to transparent, so the ring
|
|
38
|
+
melts into the page instead of ending on a hard line. Both layers are
|
|
39
|
+
masked into a donut, so nothing is ever painted over the background or
|
|
40
|
+
label. The ring's four stops are the `--ui-ai-1`…`--ui-ai-4` tokens. It
|
|
41
|
+
sweeps slowly at rest, faster on hover and while `busy`, holds still while
|
|
42
|
+
disabled or under `prefers-reduced-motion`, and drops the bloom for a
|
|
43
|
+
solid `CanvasText` ring in forced-colors mode. The bloom reaches about
|
|
44
|
+
`0.5rem` past the control, so give an AI button that much clearance from
|
|
45
|
+
its neighbors and avoid `overflow: hidden` ancestors that would clip it.
|
|
46
|
+
|
|
47
|
+
Do not combine `ai` with `pill` under the gradient theme
|
|
48
|
+
(`data-theme="gradient"`). That theme defines a button through a darker
|
|
49
|
+
`--ui-button-border` edge plus a glossy top highlight; a pill's
|
|
50
|
+
fully-rounded silhouette runs flush against the ring around its entire
|
|
51
|
+
outline, so that border and gloss read as the inner edge of the rainbow
|
|
52
|
+
rather than as the button's own shape, and the vertical gradient fill
|
|
53
|
+
stops reading as a gradient at all. Use `ai` with the default
|
|
54
|
+
`--ui-radius-sm` corners there, and keep `ai` + `pill` for the flat theme.
|
|
55
|
+
|
|
34
56
|
## Install
|
|
35
57
|
|
|
36
58
|
```js
|
|
@@ -46,6 +68,7 @@ import "@f-ewald/components/ui-button.js";
|
|
|
46
68
|
</ui-button>
|
|
47
69
|
<ui-button variant="danger">Delete</ui-button>
|
|
48
70
|
<ui-button variant="secondary" href="/properties?edit=42">Edit</ui-button>
|
|
71
|
+
<ui-button variant="primary" ai>Ask AI</ui-button>
|
|
49
72
|
```
|
|
50
73
|
|
|
51
74
|
## Attributes / properties
|
|
@@ -55,6 +78,7 @@ import "@f-ewald/components/ui-button.js";
|
|
|
55
78
|
| `variant` | `variant` | `ButtonVariant` | `"primary"` | Visual weight. |
|
|
56
79
|
| `size` | `size` | `"sm" | "md"` | `"md"` | Size — `sm` reduces height/padding/font-size one step below the default. |
|
|
57
80
|
| `pill` | `pill` | `boolean` | `false` | Renders fully rounded (pill-shaped) corners instead of the default `--ui-radius-sm`. |
|
|
81
|
+
| `ai` | `ai` | `boolean` | `false` | Draws the animated multi-hue "AI" ring (crisp edge plus a bloom fading out to transparent) around the button, on top of whatever variant/theme it already uses. |
|
|
58
82
|
| `href` | `href` | `string | null` | `null` | Renders an `<a href="...">` instead of a `<button>` when set. |
|
|
59
83
|
| `type` | `type` | `"button" | "submit" | "reset"` | `"button"` | Native button `type`. Ignored when `href` is set. |
|
|
60
84
|
| `disabled` | `disabled` | `boolean` | `false` | Disables the control and dims it. |
|
|
@@ -75,6 +99,10 @@ _None._
|
|
|
75
99
|
|
|
76
100
|
| Custom property |
|
|
77
101
|
| --- |
|
|
102
|
+
| `--ui-ai-1` |
|
|
103
|
+
| `--ui-ai-2` |
|
|
104
|
+
| `--ui-ai-3` |
|
|
105
|
+
| `--ui-ai-4` |
|
|
78
106
|
| `--ui-border` |
|
|
79
107
|
| `--ui-button-background` |
|
|
80
108
|
| `--ui-button-background-active` |
|