@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/custom-elements.json
CHANGED
|
@@ -2688,6 +2688,64 @@
|
|
|
2688
2688
|
"attribute": "date",
|
|
2689
2689
|
"reflects": true
|
|
2690
2690
|
},
|
|
2691
|
+
{
|
|
2692
|
+
"kind": "field",
|
|
2693
|
+
"name": "timeMarker",
|
|
2694
|
+
"type": {
|
|
2695
|
+
"text": "boolean"
|
|
2696
|
+
},
|
|
2697
|
+
"default": "false",
|
|
2698
|
+
"description": "Shows a fine live line marking the current time, Google-Calendar-style. Only rendered when `date` is today.",
|
|
2699
|
+
"attribute": "time-marker",
|
|
2700
|
+
"reflects": true
|
|
2701
|
+
},
|
|
2702
|
+
{
|
|
2703
|
+
"kind": "field",
|
|
2704
|
+
"name": "minWidth",
|
|
2705
|
+
"type": {
|
|
2706
|
+
"text": "string"
|
|
2707
|
+
},
|
|
2708
|
+
"default": "\"\"",
|
|
2709
|
+
"description": "Minimum width for the day column, as a CSS length (e.g. `\"18rem\"`).\nUnset leaves the host's width fully controlled by its container —\nuseful as the sizing floor when placing several `calendar-day`\nelements in a scrollable row.",
|
|
2710
|
+
"attribute": "min-width",
|
|
2711
|
+
"reflects": true
|
|
2712
|
+
},
|
|
2713
|
+
{
|
|
2714
|
+
"kind": "field",
|
|
2715
|
+
"name": "_now",
|
|
2716
|
+
"privacy": "private"
|
|
2717
|
+
},
|
|
2718
|
+
{
|
|
2719
|
+
"kind": "field",
|
|
2720
|
+
"name": "_nowTimer",
|
|
2721
|
+
"type": {
|
|
2722
|
+
"text": "ReturnType<typeof setInterval> | null"
|
|
2723
|
+
},
|
|
2724
|
+
"privacy": "private",
|
|
2725
|
+
"default": "null"
|
|
2726
|
+
},
|
|
2727
|
+
{
|
|
2728
|
+
"kind": "method",
|
|
2729
|
+
"name": "_syncNowTimer",
|
|
2730
|
+
"privacy": "private",
|
|
2731
|
+
"return": {
|
|
2732
|
+
"type": {
|
|
2733
|
+
"text": "void"
|
|
2734
|
+
}
|
|
2735
|
+
},
|
|
2736
|
+
"description": "Ensures a 60s current-time ticker is running only while `timeMarker` is enabled."
|
|
2737
|
+
},
|
|
2738
|
+
{
|
|
2739
|
+
"kind": "method",
|
|
2740
|
+
"name": "_syncMinWidth",
|
|
2741
|
+
"privacy": "private",
|
|
2742
|
+
"return": {
|
|
2743
|
+
"type": {
|
|
2744
|
+
"text": "void"
|
|
2745
|
+
}
|
|
2746
|
+
},
|
|
2747
|
+
"description": "Reflects `minWidth` onto the `--calendar-day-min-width` custom property the host's own styles read."
|
|
2748
|
+
},
|
|
2691
2749
|
{
|
|
2692
2750
|
"kind": "method",
|
|
2693
2751
|
"name": "_renderAllDayLane",
|
|
@@ -2929,6 +2987,24 @@
|
|
|
2929
2987
|
},
|
|
2930
2988
|
"description": "The day shown, `\"YYYY-MM-DD\"`.",
|
|
2931
2989
|
"fieldName": "date"
|
|
2990
|
+
},
|
|
2991
|
+
{
|
|
2992
|
+
"name": "time-marker",
|
|
2993
|
+
"type": {
|
|
2994
|
+
"text": "boolean"
|
|
2995
|
+
},
|
|
2996
|
+
"default": "false",
|
|
2997
|
+
"description": "Shows a fine live line marking the current time, Google-Calendar-style. Only rendered when `date` is today.",
|
|
2998
|
+
"fieldName": "timeMarker"
|
|
2999
|
+
},
|
|
3000
|
+
{
|
|
3001
|
+
"name": "min-width",
|
|
3002
|
+
"type": {
|
|
3003
|
+
"text": "string"
|
|
3004
|
+
},
|
|
3005
|
+
"default": "\"\"",
|
|
3006
|
+
"description": "Minimum width for the day column, as a CSS length (e.g. `\"18rem\"`).\nUnset leaves the host's width fully controlled by its container —\nuseful as the sizing floor when placing several `calendar-day`\nelements in a scrollable row.",
|
|
3007
|
+
"fieldName": "minWidth"
|
|
2932
3008
|
}
|
|
2933
3009
|
],
|
|
2934
3010
|
"superclass": {
|
|
@@ -2978,6 +3054,10 @@
|
|
|
2978
3054
|
{
|
|
2979
3055
|
"description": "Plain-text ending note pinned to the bottom of the shared body.",
|
|
2980
3056
|
"name": "footer"
|
|
3057
|
+
},
|
|
3058
|
+
{
|
|
3059
|
+
"description": "Plain-text location, shown on its own line with a leading marker icon.",
|
|
3060
|
+
"name": "location"
|
|
2981
3061
|
}
|
|
2982
3062
|
],
|
|
2983
3063
|
"members": [
|
|
@@ -3347,7 +3427,7 @@
|
|
|
3347
3427
|
}
|
|
3348
3428
|
}
|
|
3349
3429
|
],
|
|
3350
|
-
"description": "Joins the event title, details, and visible footer for tooltips and accessible link names."
|
|
3430
|
+
"description": "Joins the event title, location, details, and visible footer for tooltips and accessible link names."
|
|
3351
3431
|
},
|
|
3352
3432
|
{
|
|
3353
3433
|
"kind": "method",
|
|
@@ -3377,7 +3457,7 @@
|
|
|
3377
3457
|
"default": "false"
|
|
3378
3458
|
}
|
|
3379
3459
|
],
|
|
3380
|
-
"description": "Renders the shared details body, with the footer reserved at
|
|
3460
|
+
"description": "Renders the shared details body, with the location pinned at the top and the footer reserved at the bottom."
|
|
3381
3461
|
},
|
|
3382
3462
|
{
|
|
3383
3463
|
"kind": "method",
|
|
@@ -3407,7 +3487,7 @@
|
|
|
3407
3487
|
"default": "false"
|
|
3408
3488
|
}
|
|
3409
3489
|
],
|
|
3410
|
-
"description": "Renders a row-spanning body cell with whole-line detail and footer budgets."
|
|
3490
|
+
"description": "Renders a row-spanning body cell with whole-line location, detail, and footer budgets."
|
|
3411
3491
|
},
|
|
3412
3492
|
{
|
|
3413
3493
|
"kind": "method",
|
|
@@ -7745,7 +7825,7 @@
|
|
|
7745
7825
|
"default": "16"
|
|
7746
7826
|
}
|
|
7747
7827
|
],
|
|
7748
|
-
"description": "
|
|
7828
|
+
"description": "An AI-powered action (pairs with ui-button's `ai` ring), a gradient-theme toggle, or a decorative/enhanced visual style."
|
|
7749
7829
|
},
|
|
7750
7830
|
{
|
|
7751
7831
|
"kind": "function",
|
|
@@ -14602,7 +14682,7 @@
|
|
|
14602
14682
|
"declarations": [
|
|
14603
14683
|
{
|
|
14604
14684
|
"kind": "class",
|
|
14605
|
-
"description": "Single-select group of full-width cards, each with a label and optional\ndescription — for a handful of meaningfully different choices where the\ndescription matters. For many short, same-shaped options (a color swatch,\na basemap style), use `radio-pills` instead. Wraps native radio inputs for\nkeyboard/a11y and fires `change` rather than relying on form submission.\n\nThe selected card's border/radio dot read `--ui-button-accent` (a solid\nstand-in, since `border-color`/`accent-color` can't render a gradient),\nand its background reads the shared `--ui-button-secondary-surface-muted`\nplus `--ui-button-highlight`, so a gradient theme tints it consistently\nwith `button-group`/`pagination-nav`'s equivalents.",
|
|
14685
|
+
"description": "Single-select group of full-width cards, each with a label and optional\ndescription — for a handful of meaningfully different choices where the\ndescription matters. For many short, same-shaped options (a color swatch,\na basemap style), use `radio-pills` instead. Wraps native radio inputs for\nkeyboard/a11y and fires `change` rather than relying on form submission.\n\nThe selected card's border/radio dot read `--ui-button-accent` (a solid\nstand-in, since `border-color`/`accent-color` can't render a gradient),\nand its background reads the shared `--ui-button-secondary-surface-muted`\nplus `--ui-button-highlight`, so a gradient theme tints it consistently\nwith `button-group`/`pagination-nav`'s equivalents. That shared value is\ntuned for small controls, so a card — with far more area — blends it 45%\ntoward `--ui-surface` rather than taking a second token: the tint stays\nthe same hue and gradient, just lighter on light themes (and\ncorrespondingly deeper on dark ones) than on a button.",
|
|
14606
14686
|
"name": "RadioCards",
|
|
14607
14687
|
"members": [
|
|
14608
14688
|
{
|
|
@@ -15383,7 +15463,7 @@
|
|
|
15383
15463
|
"declarations": [
|
|
15384
15464
|
{
|
|
15385
15465
|
"kind": "class",
|
|
15386
|
-
"description": "Overlay button that appears once the page (or a given `target` container)\nhas scrolled more than `threshold` pixels away from the bottom edge, and\nscrolls back to the bottom on click.\n\nWith no `target` (default), the button is `position: fixed` to the\nviewport. When `target` is set, the button switches to `position:\nabsolute` and expects to be placed as a descendant of a `position:\nrelative` (or otherwise positioned) ancestor that establishes the visual\nbounds to float within — typically `target` itself, given `overflow-y:\nauto; position: relative`, so the button stays pinned to that container's\nown visible corner as its content scrolls, rather than floating over the\nwhole page.",
|
|
15466
|
+
"description": "Overlay button that appears once the page (or a given `target` container)\nhas scrolled more than `threshold` pixels away from the bottom edge, and\nscrolls back to the bottom on click.\n\nWith no `target` (default), the button is `position: fixed` to the\nviewport. When `target` is set, the button switches to `position:\nabsolute` and expects to be placed as a descendant of a `position:\nrelative` (or otherwise positioned) ancestor that establishes the visual\nbounds to float within — typically `target` itself, given `overflow-y:\nauto; position: relative`, so the button stays pinned to that container's\nown visible corner as its content scrolls, rather than floating over the\nwhole page.\n\nThe control is styled as a standard secondary button (ui-button's\n`secondary` variant: 2rem tall, `--ui-radius-sm` corners, the\n`--ui-button-secondary-*` background/border tokens, so a gradient theme\ncarries over) rather than a pill, layered over an opaque `--ui-surface`\nbase and an elevation shadow, since it floats above scrolled content.",
|
|
15387
15467
|
"name": "ScrollToBottom",
|
|
15388
15468
|
"members": [
|
|
15389
15469
|
{
|
|
@@ -15531,7 +15611,7 @@
|
|
|
15531
15611
|
"declarations": [
|
|
15532
15612
|
{
|
|
15533
15613
|
"kind": "class",
|
|
15534
|
-
"description": "Overlay button that appears once the page (or a given `target` container)\nhas scrolled more than `threshold` pixels away from the top edge, and\nscrolls back to the top on click.\n\nWith no `target` (default), the button is `position: fixed` to the\nviewport. When `target` is set, the button switches to `position:\nabsolute` and expects to be placed as a descendant of a `position:\nrelative` (or otherwise positioned) ancestor that establishes the visual\nbounds to float within — typically `target` itself, given `overflow-y:\nauto; position: relative`, so the button stays pinned to that container's\nown visible corner as its content scrolls, rather than floating over the\nwhole page.",
|
|
15614
|
+
"description": "Overlay button that appears once the page (or a given `target` container)\nhas scrolled more than `threshold` pixels away from the top edge, and\nscrolls back to the top on click.\n\nWith no `target` (default), the button is `position: fixed` to the\nviewport. When `target` is set, the button switches to `position:\nabsolute` and expects to be placed as a descendant of a `position:\nrelative` (or otherwise positioned) ancestor that establishes the visual\nbounds to float within — typically `target` itself, given `overflow-y:\nauto; position: relative`, so the button stays pinned to that container's\nown visible corner as its content scrolls, rather than floating over the\nwhole page.\n\nThe control is styled as a standard secondary button (ui-button's\n`secondary` variant: 2rem tall, `--ui-radius-sm` corners, the\n`--ui-button-secondary-*` background/border tokens, so a gradient theme\ncarries over) rather than a pill, layered over an opaque `--ui-surface`\nbase and an elevation shadow, since it floats above scrolled content.",
|
|
15535
15615
|
"name": "ScrollToTop",
|
|
15536
15616
|
"members": [
|
|
15537
15617
|
{
|
|
@@ -17292,7 +17372,7 @@
|
|
|
17292
17372
|
"type": {
|
|
17293
17373
|
"text": "Record<string, string>"
|
|
17294
17374
|
},
|
|
17295
|
-
"default": "{ // Colors \"--ui-primary\": \"#4f46e5\", // indigo-600 \"--ui-primary-hover\": \"#4338ca\", // indigo-700 // Button-specific background/border hooks: default to the flat --ui-primary // / --ui-danger tokens above unchanged, so those stay the single source of // truth for every other component. Overriding just these lets a theme opt // ui-button into a gradient (or any other) background without touching // component markup; --ui-button-border/--ui-button-danger-border default // to transparent (today's look) and are meant to be paired with a shade // darker than the gradient's dark stop when one is set. The `-active` // variants default to whatever `-background` already resolved to (so a // solid override still applies while pressed) — a gradient theme should // set them to the same stops in reverse, for a pressed/\"indented\" look. \"--ui-button-background\": \"var(--ui-primary, #4f46e5)\", \"--ui-button-background-hover\": \"var(--ui-primary-hover, #4338ca)\", \"--ui-button-background-active\": \"var(--ui-button-background, var(--ui-primary, #4f46e5))\", \"--ui-button-border\": \"transparent\", // The bordered, transparent-background secondary variant's equivalents — // shared with confirm-dialog's Cancel button, which is the same visual // pattern. Defaults reproduce today's literal secondary styling exactly // (no background at any state, border colors matching --ui-border / // --ui-text-muted), so a theme only needs to override these to make // secondary/Cancel buttons match a primary/danger gradient theme. \"--ui-button-secondary-background\": \"none\", \"--ui-button-secondary-background-hover\": \"none\", \"--ui-button-secondary-background-active\": \"var(--ui-button-secondary-background, none)\", \"--ui-button-secondary-border\": \"var(--ui-border, #e2e8f0)\", \"--ui-button-secondary-border-hover\": \"var(--ui-text-muted, #64748b)\", // A muted-gray surface used wherever something already paints // --ui-surface-muted as a state indicator in flat mode — button-group's // unchecked-segment hover, pagination-nav's button hover, and // radio-cards/radio-pills' checked background — which is a genuinely // different default than secondary's borderless flat hover, so it can't // reuse --ui-button-secondary-background-hover's \"none\" default. \"--ui-button-secondary-surface-muted\": \"var(--ui-surface-muted, #f8fafc)\", // Shared by both primary/danger — a purely cosmetic gloss/legibility pair, // not color-specific, so one token covers both variants. `-highlight` is a // full box-shadow value (e.g. `inset 0 1px 0 rgb(255 255 255 / 0.35)`) for // a glossy top edge, defaulting to a fully transparent (so invisible) // shadow rather than the keyword `none` — some usages combine it with // another literal shadow in a comma-separated list, where a bare `none` // item is invalid CSS and would zero out the *whole* declaration. // `-text-shadow` is a full text-shadow value for label legibility against // a gradient's lighter stop, always used standalone, so it keeps `none`. \"--ui-button-highlight\": \"0 0 0 0 transparent\", \"--ui-button-text-shadow\": \"none\", // A solid stand-in for the same accent, for spots that can't render a // background gradient at all — a native <input>'s accent-color only // accepts a plain color, and a hard-stop background gradient (e.g. // range-slider's filled track) can't nest another gradient inside its own // color-stop list. Consumers that theme the buttons into a gradient should // set this to the gradient's dark stop, so these non-button accents (radio // selection indicators, the range-slider track/thumb) stay visually // coordinated with it even though they can't literally paint a gradient. \"--ui-button-accent\": \"var(--ui-primary, #4f46e5)\", \"--ui-info\": \"#0ea5e9\", // sky-500 \"--ui-info-hover\": \"#0284c7\", // sky-600 \"--ui-danger\": \"#dc2626\", // red-600 \"--ui-danger-hover\": \"#b91c1c\", // red-700 \"--ui-button-danger-background\": \"var(--ui-danger, #dc2626)\", \"--ui-button-danger-background-hover\": \"var(--ui-danger-hover, #b91c1c)\", \"--ui-button-danger-background-active\": \"var(--ui-button-danger-background, var(--ui-danger, #dc2626))\", \"--ui-button-danger-border\": \"transparent\", \"--ui-success\": \"#16a34a\", // green-600 \"--ui-warning\": \"#d97706\", // amber-600 \"--ui-warning-hover\": \"#b45309\", // amber-700 // toast-notification's per-variant background hooks: default to the flat // --ui-success/--ui-danger/--ui-info/--ui-warning tokens unchanged, so // those stay the single source of truth for every other component — // the same pattern as --ui-button-background/--ui-button-danger-background // above. `-highlight`/`-text-shadow` are the same glossy-top-edge / // legibility-shadow pair as --ui-button-highlight/--ui-button-text-shadow, // kept as separate tokens so a theme can gloss toasts and buttons // independently. \"--ui-toast-success-background\": \"var(--ui-success, #16a34a)\", \"--ui-toast-error-background\": \"var(--ui-danger, #dc2626)\", \"--ui-toast-info-background\": \"var(--ui-info, #0ea5e9)\", \"--ui-toast-warning-background\": \"var(--ui-warning, #d97706)\", \"--ui-toast-highlight\": \"0 0 0 0 transparent\", \"--ui-toast-text-shadow\": \"none\", \"--ui-on-accent\": \"#ffffff\", \"--ui-text\": \"#0f172a\", // slate-900 \"--ui-text-muted\": \"#64748b\", // slate-500 \"--ui-border\": \"#e2e8f0\", // slate-200 \"--ui-surface\": \"#ffffff\", // white \"--ui-surface-muted\": \"#f8fafc\", // slate-50 \"--ui-highlight\": \"#fde68a\", // amber-200 — transient \"just changed\" flash \"--ui-tooltip\": \"#0f172a\", // slate-900 \"--ui-hover-overlay\": \"rgb(255 255 255 / 0.32)\", \"--ui-overlay\": \"rgb(15 23 42 / 0.45)\", // slate-900 / 45% // Shape / depth \"--ui-radius\": \"0.5rem\", // rounded-lg \"--ui-radius-sm\": \"0.25rem\", // rounded \"--ui-shadow\": \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\", // shadow-md \"--ui-shadow-lg\": \"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)\", // shadow-xl \"--ui-focus-ring\": \"0 0 0 3px rgb(79 70 229 / 0.35)\", // Type \"--ui-font\": 'ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"', \"--ui-font-mono\": \"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\", \"--ui-font-size-lg\": \"1rem\", // text-base \"--ui-font-size\": \"0.875rem\", // text-sm \"--ui-font-size-sm\": \"0.75rem\", // text-xs \"--ui-font-size-xs\": \"0.6875rem\", // Font weights — the only four weights the system uses. \"--ui-font-weight-regular\": \"400\", \"--ui-font-weight-medium\": \"500\", \"--ui-font-weight-semibold\": \"600\", \"--ui-font-weight-bold\": \"700\", // Line heights — glyph (icon/marker box), tight (headings), normal (body). \"--ui-line-height-glyph\": \"1\", \"--ui-line-height-tight\": \"1.25\", \"--ui-line-height-normal\": \"1.5\", // Letter spacing / tracking — default and the single widened step. \"--ui-tracking-normal\": \"0\", \"--ui-tracking-wide\": \"0.04em\", }",
|
|
17375
|
+
"default": "{ // Colors \"--ui-primary\": \"#4f46e5\", // indigo-600 \"--ui-primary-hover\": \"#4338ca\", // indigo-700 // Button-specific background/border hooks: default to the flat --ui-primary // / --ui-danger tokens above unchanged, so those stay the single source of // truth for every other component. Overriding just these lets a theme opt // ui-button into a gradient (or any other) background without touching // component markup; --ui-button-border/--ui-button-danger-border default // to transparent (today's look) and are meant to be paired with a shade // darker than the gradient's dark stop when one is set. The `-active` // variants default to whatever `-background` already resolved to (so a // solid override still applies while pressed) — a gradient theme should // set them to the same stops in reverse, for a pressed/\"indented\" look. \"--ui-button-background\": \"var(--ui-primary, #4f46e5)\", \"--ui-button-background-hover\": \"var(--ui-primary-hover, #4338ca)\", \"--ui-button-background-active\": \"var(--ui-button-background, var(--ui-primary, #4f46e5))\", \"--ui-button-border\": \"transparent\", // The bordered, transparent-background secondary variant's equivalents — // shared with confirm-dialog's Cancel button, which is the same visual // pattern. Defaults reproduce today's literal secondary styling exactly // (no background at any state, border colors matching --ui-border / // --ui-text-muted), so a theme only needs to override these to make // secondary/Cancel buttons match a primary/danger gradient theme. \"--ui-button-secondary-background\": \"none\", \"--ui-button-secondary-background-hover\": \"none\", \"--ui-button-secondary-background-active\": \"var(--ui-button-secondary-background, none)\", \"--ui-button-secondary-border\": \"var(--ui-border, #e2e8f0)\", \"--ui-button-secondary-border-hover\": \"var(--ui-text-muted, #64748b)\", // A muted-gray surface used wherever something already paints // --ui-surface-muted as a state indicator in flat mode — button-group's // unchecked-segment hover, pagination-nav's button hover, and // radio-cards/radio-pills' checked background — which is a genuinely // different default than secondary's borderless flat hover, so it can't // reuse --ui-button-secondary-background-hover's \"none\" default. \"--ui-button-secondary-surface-muted\": \"var(--ui-surface-muted, #f8fafc)\", // Shared by both primary/danger — a purely cosmetic gloss/legibility pair, // not color-specific, so one token covers both variants. `-highlight` is a // full box-shadow value (e.g. `inset 0 1px 0 rgb(255 255 255 / 0.35)`) for // a glossy top edge, defaulting to a fully transparent (so invisible) // shadow rather than the keyword `none` — some usages combine it with // another literal shadow in a comma-separated list, where a bare `none` // item is invalid CSS and would zero out the *whole* declaration. // `-text-shadow` is a full text-shadow value for label legibility against // a gradient's lighter stop, always used standalone, so it keeps `none`. \"--ui-button-highlight\": \"0 0 0 0 transparent\", \"--ui-button-text-shadow\": \"none\", // A solid stand-in for the same accent, for spots that can't render a // background gradient at all — a native <input>'s accent-color only // accepts a plain color, and a hard-stop background gradient (e.g. // range-slider's filled track) can't nest another gradient inside its own // color-stop list. Consumers that theme the buttons into a gradient should // set this to the gradient's dark stop, so these non-button accents (radio // selection indicators, the range-slider track/thumb) stay visually // coordinated with it even though they can't literally paint a gradient. \"--ui-button-accent\": \"var(--ui-primary, #4f46e5)\", \"--ui-info\": \"#0ea5e9\", // sky-500 \"--ui-info-hover\": \"#0284c7\", // sky-600 \"--ui-danger\": \"#dc2626\", // red-600 \"--ui-danger-hover\": \"#b91c1c\", // red-700 \"--ui-button-danger-background\": \"var(--ui-danger, #dc2626)\", \"--ui-button-danger-background-hover\": \"var(--ui-danger-hover, #b91c1c)\", \"--ui-button-danger-background-active\": \"var(--ui-button-danger-background, var(--ui-danger, #dc2626))\", \"--ui-button-danger-border\": \"transparent\", \"--ui-success\": \"#16a34a\", // green-600 \"--ui-warning\": \"#d97706\", // amber-600 \"--ui-warning-hover\": \"#b45309\", // amber-700 // toast-notification's per-variant background hooks: default to the flat // --ui-success/--ui-danger/--ui-info/--ui-warning tokens unchanged, so // those stay the single source of truth for every other component — // the same pattern as --ui-button-background/--ui-button-danger-background // above. `-highlight`/`-text-shadow` are the same glossy-top-edge / // legibility-shadow pair as --ui-button-highlight/--ui-button-text-shadow, // kept as separate tokens so a theme can gloss toasts and buttons // independently. \"--ui-toast-success-background\": \"var(--ui-success, #16a34a)\", \"--ui-toast-error-background\": \"var(--ui-danger, #dc2626)\", \"--ui-toast-info-background\": \"var(--ui-info, #0ea5e9)\", \"--ui-toast-warning-background\": \"var(--ui-warning, #d97706)\", \"--ui-toast-highlight\": \"0 0 0 0 transparent\", \"--ui-toast-text-shadow\": \"none\", // AI accent sweep — the four stops of the animated multi-hue ring // ui-button's `ai` modifier draws around a button (and the only place a // rainbow reads as meaning \"this action is AI-powered\" rather than a // semantic state). Ordered around the color wheel and looping back to // stop 1, so the sweep is seamless; --ui-ai-2 is --ui-primary's own // indigo, anchoring the ring to the rest of the palette. Overriding these // four retunes every AI button at once. \"--ui-ai-1\": \"#38bdf8\", // sky-400 \"--ui-ai-2\": \"#6366f1\", // indigo-500 \"--ui-ai-3\": \"#d946ef\", // fuchsia-500 \"--ui-ai-4\": \"#fbbf24\", // amber-400 \"--ui-on-accent\": \"#ffffff\", \"--ui-text\": \"#0f172a\", // slate-900 \"--ui-text-muted\": \"#64748b\", // slate-500 \"--ui-border\": \"#e2e8f0\", // slate-200 \"--ui-surface\": \"#ffffff\", // white \"--ui-surface-muted\": \"#f8fafc\", // slate-50 \"--ui-highlight\": \"#fde68a\", // amber-200 — transient \"just changed\" flash \"--ui-tooltip\": \"#0f172a\", // slate-900 \"--ui-hover-overlay\": \"rgb(255 255 255 / 0.32)\", \"--ui-overlay\": \"rgb(15 23 42 / 0.45)\", // slate-900 / 45% // Shape / depth \"--ui-radius\": \"0.5rem\", // rounded-lg \"--ui-radius-sm\": \"0.25rem\", // rounded \"--ui-shadow\": \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\", // shadow-md \"--ui-shadow-lg\": \"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)\", // shadow-xl \"--ui-focus-ring\": \"0 0 0 3px rgb(79 70 229 / 0.35)\", // Type \"--ui-font\": 'ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"', \"--ui-font-mono\": \"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\", \"--ui-font-size-lg\": \"1rem\", // text-base \"--ui-font-size\": \"0.875rem\", // text-sm \"--ui-font-size-sm\": \"0.75rem\", // text-xs \"--ui-font-size-xs\": \"0.6875rem\", // Font weights — the only four weights the system uses. \"--ui-font-weight-regular\": \"400\", \"--ui-font-weight-medium\": \"500\", \"--ui-font-weight-semibold\": \"600\", \"--ui-font-weight-bold\": \"700\", // Line heights — glyph (icon/marker box), tight (headings), normal (body). \"--ui-line-height-glyph\": \"1\", \"--ui-line-height-tight\": \"1.25\", \"--ui-line-height-normal\": \"1.5\", // Letter spacing / tracking — default and the single widened step. \"--ui-tracking-normal\": \"0\", \"--ui-tracking-wide\": \"0.04em\", }",
|
|
17296
17376
|
"description": "Design token values, sourced from Tailwind v4's default theme palette.\nEach entry maps a `--ui-*` custom property name to its default value.\nThese are the same values baked in as `var(--ui-*, <fallback>)` fallbacks\nthroughout component styles, so components render correctly with zero\nexternal CSS. Consumers may override any of these by setting the custom\nproperty on `:root` or an ancestor element (see `tokens.css`)."
|
|
17297
17377
|
},
|
|
17298
17378
|
{
|
|
@@ -17624,7 +17704,7 @@
|
|
|
17624
17704
|
"declarations": [
|
|
17625
17705
|
{
|
|
17626
17706
|
"kind": "class",
|
|
17627
|
-
"description": "Button (or link styled as one) with an optional leading icon, in three\nvisual weights. Set `href` to render an `<a>` instead of a `<button>` —\nsame styling either way — for cross-page navigation that should look like\nan action button; a disabled/busy link stays a real `<a>` with\n`aria-disabled` + `pointer-events: none` rather than losing its href.\nPut the icon in the `icon` slot and the label in the default slot.\n\nForm-associated (`type=\"submit\"`/`\"reset\"`): the actual `<button>` lives in\nthis element's shadow root, which native HTML form association does not\ncross into from an ancestor light-DOM `<form>`. `type=\"submit\"`/`\"reset\"`\nis instead wired through `ElementInternals.form` — the same mechanism\n`address-autocomplete` uses to associate with an ancestor form.\n\n`primary`/`danger` backgrounds read `--ui-button-background`/\n`--ui-button-danger-background` (and their `-hover`/`-active`\ncounterparts), which default to the flat `--ui-primary`/`--ui-danger`\ntokens unchanged — so `--ui-primary`/`--ui-danger` stay the single source\nof truth for every other component. A consumer can override just these\nbutton-specific tokens with a `linear-gradient(...)` to opt every\n`ui-button` into a gradient look without touching component markup —\n`gradientTokenValues` in `tokens.ts` ships exactly this, wired up via\n`data-theme=\"gradient\"` (see `tokens.css`'s \"Gradient theme\" section) —\npairing it with `--ui-button-border`/`--ui-button-danger-border` (default\n`transparent`) for a defining edge a shade darker than the gradient's dark\nstop, and setting the `-active` variant's stops in reverse for a\npressed/\"indented\" look while the button is held down. `secondary`'s\nbackground/border read the equivalent `--ui-button-secondary-*` tokens\n(shared with `confirm-dialog`'s Cancel button), defaulting to today's\ntransparent/bordered look, so it can be themed into a matching (e.g.\nwhite-to-gray) gradient too.",
|
|
17707
|
+
"description": "Button (or link styled as one) with an optional leading icon, in three\nvisual weights. Set `href` to render an `<a>` instead of a `<button>` —\nsame styling either way — for cross-page navigation that should look like\nan action button; a disabled/busy link stays a real `<a>` with\n`aria-disabled` + `pointer-events: none` rather than losing its href.\nPut the icon in the `icon` slot and the label in the default slot.\n\nForm-associated (`type=\"submit\"`/`\"reset\"`): the actual `<button>` lives in\nthis element's shadow root, which native HTML form association does not\ncross into from an ancestor light-DOM `<form>`. `type=\"submit\"`/`\"reset\"`\nis instead wired through `ElementInternals.form` — the same mechanism\n`address-autocomplete` uses to associate with an ancestor form.\n\n`primary`/`danger` backgrounds read `--ui-button-background`/\n`--ui-button-danger-background` (and their `-hover`/`-active`\ncounterparts), which default to the flat `--ui-primary`/`--ui-danger`\ntokens unchanged — so `--ui-primary`/`--ui-danger` stay the single source\nof truth for every other component. A consumer can override just these\nbutton-specific tokens with a `linear-gradient(...)` to opt every\n`ui-button` into a gradient look without touching component markup —\n`gradientTokenValues` in `tokens.ts` ships exactly this, wired up via\n`data-theme=\"gradient\"` (see `tokens.css`'s \"Gradient theme\" section) —\npairing it with `--ui-button-border`/`--ui-button-danger-border` (default\n`transparent`) for a defining edge a shade darker than the gradient's dark\nstop, and setting the `-active` variant's stops in reverse for a\npressed/\"indented\" look while the button is held down. `secondary`'s\nbackground/border read the equivalent `--ui-button-secondary-*` tokens\n(shared with `confirm-dialog`'s Cancel button), defaulting to today's\ntransparent/bordered look, so it can be themed into a matching (e.g.\nwhite-to-gray) gradient too.\n\n`ai` is an orthogonal modifier rather than a fourth variant: it leaves the\nvariant's fill (flat or gradient-themed) untouched and only adds an\nanimated multi-hue ring *outside* the button box — a crisp masked edge\nplus a blurred bloom behind it that fades out to transparent, so the ring\nmelts into the page instead of ending on a hard line. Both layers are\nmasked into a donut, so nothing is ever painted over the background or\nlabel. The ring's four stops are the `--ui-ai-1`…`--ui-ai-4` tokens. It\nsweeps slowly at rest, faster on hover and while `busy`, holds still while\ndisabled or under `prefers-reduced-motion`, and drops the bloom for a\nsolid `CanvasText` ring in forced-colors mode. The bloom reaches about\n`0.5rem` past the control, so give an AI button that much clearance from\nits neighbors and avoid `overflow: hidden` ancestors that would clip it.\n\nDo not combine `ai` with `pill` under the gradient theme\n(`data-theme=\"gradient\"`). That theme defines a button through a darker\n`--ui-button-border` edge plus a glossy top highlight; a pill's\nfully-rounded silhouette runs flush against the ring around its entire\noutline, so that border and gloss read as the inner edge of the rainbow\nrather than as the button's own shape, and the vertical gradient fill\nstops reading as a gradient at all. Use `ai` with the default\n`--ui-radius-sm` corners there, and keep `ai` + `pill` for the flat theme.",
|
|
17628
17708
|
"name": "UiButton",
|
|
17629
17709
|
"slots": [
|
|
17630
17710
|
{
|
|
@@ -17681,6 +17761,17 @@
|
|
|
17681
17761
|
"description": "Renders fully rounded (pill-shaped) corners instead of the default `--ui-radius-sm`.",
|
|
17682
17762
|
"attribute": "pill"
|
|
17683
17763
|
},
|
|
17764
|
+
{
|
|
17765
|
+
"kind": "field",
|
|
17766
|
+
"name": "ai",
|
|
17767
|
+
"type": {
|
|
17768
|
+
"text": "boolean"
|
|
17769
|
+
},
|
|
17770
|
+
"default": "false",
|
|
17771
|
+
"description": "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.",
|
|
17772
|
+
"attribute": "ai",
|
|
17773
|
+
"reflects": true
|
|
17774
|
+
},
|
|
17684
17775
|
{
|
|
17685
17776
|
"kind": "field",
|
|
17686
17777
|
"name": "href",
|
|
@@ -17770,6 +17861,15 @@
|
|
|
17770
17861
|
"description": "Renders fully rounded (pill-shaped) corners instead of the default `--ui-radius-sm`.",
|
|
17771
17862
|
"fieldName": "pill"
|
|
17772
17863
|
},
|
|
17864
|
+
{
|
|
17865
|
+
"name": "ai",
|
|
17866
|
+
"type": {
|
|
17867
|
+
"text": "boolean"
|
|
17868
|
+
},
|
|
17869
|
+
"default": "false",
|
|
17870
|
+
"description": "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.",
|
|
17871
|
+
"fieldName": "ai"
|
|
17872
|
+
},
|
|
17773
17873
|
{
|
|
17774
17874
|
"name": "href",
|
|
17775
17875
|
"type": {
|
package/dist/calendar-day.d.ts
CHANGED
|
@@ -19,7 +19,28 @@ import { CalendarTimelineBase } from "./calendar-timeline-base.js";
|
|
|
19
19
|
export declare class CalendarDay extends CalendarTimelineBase {
|
|
20
20
|
/** The day shown, `"YYYY-MM-DD"`. */
|
|
21
21
|
date: string;
|
|
22
|
+
/** Shows a fine live line marking the current time, Google-Calendar-style. Only rendered when `date` is today. */
|
|
23
|
+
timeMarker: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Minimum width for the day column, as a CSS length (e.g. `"18rem"`).
|
|
26
|
+
* Unset leaves the host's width fully controlled by its container —
|
|
27
|
+
* useful as the sizing floor when placing several `calendar-day`
|
|
28
|
+
* elements in a scrollable row.
|
|
29
|
+
*/
|
|
30
|
+
minWidth: string;
|
|
31
|
+
private _now;
|
|
32
|
+
private _nowTimer;
|
|
22
33
|
static styles: import("lit").CSSResult[];
|
|
34
|
+
/** Starts the current-time ticker if `time-marker` is already set on connect. */
|
|
35
|
+
connectedCallback(): void;
|
|
36
|
+
/** Stops the current-time ticker when this element disconnects. */
|
|
37
|
+
disconnectedCallback(): void;
|
|
38
|
+
/** Starts/stops the current-time ticker and re-syncs the min-width host style to match the latest properties. */
|
|
39
|
+
protected updated(): void;
|
|
40
|
+
/** Ensures a 60s current-time ticker is running only while `timeMarker` is enabled. */
|
|
41
|
+
private _syncNowTimer;
|
|
42
|
+
/** Reflects `minWidth` onto the `--calendar-day-min-width` custom property the host's own styles read. */
|
|
43
|
+
private _syncMinWidth;
|
|
23
44
|
/** Renders one lane's stacked all-day bars, given the entries assigned to it. */
|
|
24
45
|
private _renderAllDayLane;
|
|
25
46
|
/** Renders a positioned/sized block for one timed entry, clamped to this day's bounds. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-day.d.ts","sourceRoot":"","sources":["../src/calendar-day.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"calendar-day.d.ts","sourceRoot":"","sources":["../src/calendar-day.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAwBnE;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,WAAY,SAAQ,oBAAoB;IACnD,qCAAqC;IACR,IAAI,EAAE,MAAM,CAAyB;IAElE,kHAAkH;IAC5C,UAAU,UAAS;IAEzF;;;;;OAKG;IACkD,QAAQ,SAAM;IAE1D,OAAO,CAAC,IAAI,CAAc;IAEnC,OAAO,CAAC,SAAS,CAA+C;IAEhE,OAAgB,MAAM,4BAkNpB;IAEF,iFAAiF;IACxE,iBAAiB,IAAI,IAAI,CAGjC;IAED,mEAAmE;IAC1D,oBAAoB,IAAI,IAAI,CAIpC;IAED,iHAAiH;IACjH,UAAmB,OAAO,IAAI,IAAI,CAIjC;IAED,uFAAuF;IACvF,OAAO,CAAC,aAAa;IAYrB,0GAA0G;IAC1G,OAAO,CAAC,aAAa;IAQrB,iFAAiF;IACjF,OAAO,CAAC,iBAAiB;IA0BzB,0FAA0F;IAC1F,OAAO,CAAC,iBAAiB;IA0BzB,UAAmB,MAAM,yCAsDxB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
package/dist/calendar-day.js
CHANGED
|
@@ -5,11 +5,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { css, html, nothing } from "lit";
|
|
8
|
-
import { customElement, property } from "lit/decorators.js";
|
|
8
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
9
9
|
import { repeat } from "lit/directives/repeat.js";
|
|
10
10
|
import { CalendarTimelineBase } from "./calendar-timeline-base.js";
|
|
11
|
+
import { iconMapPin } from "./icons.js";
|
|
11
12
|
import { tokens } from "./tokens.js";
|
|
12
|
-
import { assignLanes, minutesSinceMidnight, monthName, parseIsoDate, toIsoDate, } from "./utils/calendar.js";
|
|
13
|
+
import { assignLanes, isWeekend, minutesSinceMidnight, monthName, parseIsoDate, toIsoDate, } from "./utils/calendar.js";
|
|
14
|
+
const NOW_MARKER_INTERVAL_MS = 60_000;
|
|
13
15
|
const HOUR_HEIGHT_REM = 3;
|
|
14
16
|
const HOURS = Array.from({ length: 24 }, (_, i) => i);
|
|
15
17
|
const hourLabelFormatter = new Intl.DateTimeFormat(undefined, { hour: "numeric" });
|
|
@@ -39,12 +41,24 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
39
41
|
super(...arguments);
|
|
40
42
|
/** The day shown, `"YYYY-MM-DD"`. */
|
|
41
43
|
this.date = toIsoDate(new Date());
|
|
44
|
+
/** Shows a fine live line marking the current time, Google-Calendar-style. Only rendered when `date` is today. */
|
|
45
|
+
this.timeMarker = false;
|
|
46
|
+
/**
|
|
47
|
+
* Minimum width for the day column, as a CSS length (e.g. `"18rem"`).
|
|
48
|
+
* Unset leaves the host's width fully controlled by its container —
|
|
49
|
+
* useful as the sizing floor when placing several `calendar-day`
|
|
50
|
+
* elements in a scrollable row.
|
|
51
|
+
*/
|
|
52
|
+
this.minWidth = "";
|
|
53
|
+
this._now = Date.now();
|
|
54
|
+
this._nowTimer = null;
|
|
42
55
|
}
|
|
43
56
|
static { this.styles = [
|
|
44
57
|
tokens,
|
|
45
58
|
css `
|
|
46
59
|
:host {
|
|
47
60
|
display: block;
|
|
61
|
+
min-width: var(--calendar-day-min-width, 0);
|
|
48
62
|
font-family: var(
|
|
49
63
|
--ui-font,
|
|
50
64
|
ui-sans-serif,
|
|
@@ -72,6 +86,9 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
72
86
|
font-weight: var(--ui-font-weight-semibold, 600);
|
|
73
87
|
line-height: var(--ui-line-height-tight, 1.25);
|
|
74
88
|
}
|
|
89
|
+
.day-name.weekend {
|
|
90
|
+
color: var(--ui-text-muted, #64748b);
|
|
91
|
+
}
|
|
75
92
|
.day-name.today {
|
|
76
93
|
color: var(--ui-primary, #4f46e5);
|
|
77
94
|
}
|
|
@@ -123,9 +140,32 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
123
140
|
flex: 1 1 auto;
|
|
124
141
|
height: ${HOUR_HEIGHT_REM * 24}rem;
|
|
125
142
|
}
|
|
143
|
+
.day-column.weekend {
|
|
144
|
+
background: var(--ui-surface-muted, #f8fafc);
|
|
145
|
+
}
|
|
126
146
|
.day-column.today {
|
|
127
147
|
background: color-mix(in srgb, var(--ui-primary, #4f46e5) 6%, transparent);
|
|
128
148
|
}
|
|
149
|
+
.now-line {
|
|
150
|
+
position: absolute;
|
|
151
|
+
left: 0;
|
|
152
|
+
right: 0;
|
|
153
|
+
height: 2px;
|
|
154
|
+
background: var(--ui-danger, #dc2626);
|
|
155
|
+
pointer-events: none;
|
|
156
|
+
z-index: 2;
|
|
157
|
+
}
|
|
158
|
+
.now-line::before {
|
|
159
|
+
content: "";
|
|
160
|
+
position: absolute;
|
|
161
|
+
top: 50%;
|
|
162
|
+
left: -3px;
|
|
163
|
+
width: 8px;
|
|
164
|
+
height: 8px;
|
|
165
|
+
border-radius: 50%;
|
|
166
|
+
background: var(--ui-danger, #dc2626);
|
|
167
|
+
transform: translateY(-50%);
|
|
168
|
+
}
|
|
129
169
|
.hour-line {
|
|
130
170
|
box-sizing: border-box;
|
|
131
171
|
height: ${HOUR_HEIGHT_REM}rem;
|
|
@@ -155,6 +195,21 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
155
195
|
text-overflow: ellipsis;
|
|
156
196
|
pointer-events: none;
|
|
157
197
|
}
|
|
198
|
+
.entry-location {
|
|
199
|
+
display: flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
gap: 0.25rem;
|
|
202
|
+
overflow: hidden;
|
|
203
|
+
color: inherit;
|
|
204
|
+
font-size: var(--ui-font-size-xs, 0.6875rem);
|
|
205
|
+
font-weight: var(--ui-font-weight-regular, 400);
|
|
206
|
+
white-space: nowrap;
|
|
207
|
+
text-overflow: ellipsis;
|
|
208
|
+
pointer-events: none;
|
|
209
|
+
}
|
|
210
|
+
.entry-location svg {
|
|
211
|
+
flex: 0 0 auto;
|
|
212
|
+
}
|
|
158
213
|
.entry-link {
|
|
159
214
|
position: absolute;
|
|
160
215
|
z-index: 1;
|
|
@@ -209,21 +264,69 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
209
264
|
}
|
|
210
265
|
`,
|
|
211
266
|
]; }
|
|
267
|
+
/** Starts the current-time ticker if `time-marker` is already set on connect. */
|
|
268
|
+
connectedCallback() {
|
|
269
|
+
super.connectedCallback();
|
|
270
|
+
this._syncNowTimer();
|
|
271
|
+
}
|
|
272
|
+
/** Stops the current-time ticker when this element disconnects. */
|
|
273
|
+
disconnectedCallback() {
|
|
274
|
+
super.disconnectedCallback();
|
|
275
|
+
if (this._nowTimer != null)
|
|
276
|
+
clearInterval(this._nowTimer);
|
|
277
|
+
this._nowTimer = null;
|
|
278
|
+
}
|
|
279
|
+
/** Starts/stops the current-time ticker and re-syncs the min-width host style to match the latest properties. */
|
|
280
|
+
updated() {
|
|
281
|
+
super.updated();
|
|
282
|
+
this._syncNowTimer();
|
|
283
|
+
this._syncMinWidth();
|
|
284
|
+
}
|
|
285
|
+
/** Ensures a 60s current-time ticker is running only while `timeMarker` is enabled. */
|
|
286
|
+
_syncNowTimer() {
|
|
287
|
+
if (this.timeMarker && this._nowTimer == null) {
|
|
288
|
+
this._now = Date.now();
|
|
289
|
+
this._nowTimer = setInterval(() => {
|
|
290
|
+
this._now = Date.now();
|
|
291
|
+
}, NOW_MARKER_INTERVAL_MS);
|
|
292
|
+
}
|
|
293
|
+
else if (!this.timeMarker && this._nowTimer != null) {
|
|
294
|
+
clearInterval(this._nowTimer);
|
|
295
|
+
this._nowTimer = null;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/** Reflects `minWidth` onto the `--calendar-day-min-width` custom property the host's own styles read. */
|
|
299
|
+
_syncMinWidth() {
|
|
300
|
+
if (this.minWidth) {
|
|
301
|
+
this.style.setProperty("--calendar-day-min-width", this.minWidth);
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
this.style.removeProperty("--calendar-day-min-width");
|
|
305
|
+
}
|
|
306
|
+
}
|
|
212
307
|
/** Renders one lane's stacked all-day bars, given the entries assigned to it. */
|
|
213
308
|
_renderAllDayLane(laned, lane) {
|
|
214
309
|
const entries = laned.filter((entry) => entry.lane === lane);
|
|
215
310
|
return html `
|
|
216
311
|
<div class="all-day-lane">
|
|
217
|
-
${entries.map((entry) =>
|
|
312
|
+
${entries.map((entry) => {
|
|
313
|
+
const bodyText = [entry.label, entry.location].filter(Boolean).join(" · ");
|
|
314
|
+
return html `
|
|
218
315
|
<div
|
|
219
316
|
class="entry-bar ${entry.color}"
|
|
220
317
|
data-entry-key=${this.entryKey(entry)}
|
|
221
|
-
title=${entry.href ? nothing :
|
|
318
|
+
title=${entry.href ? nothing : bodyText}
|
|
222
319
|
>
|
|
223
|
-
${this.renderEntryLink(entry,
|
|
320
|
+
${this.renderEntryLink(entry, bodyText)}
|
|
224
321
|
<span class="entry-title" aria-hidden=${entry.href ? "true" : nothing}>${entry.label}</span>
|
|
322
|
+
${entry.location
|
|
323
|
+
? html `<span class="entry-location" aria-hidden=${entry.href ? "true" : nothing}
|
|
324
|
+
>${iconMapPin(14)}${entry.location}</span
|
|
325
|
+
>`
|
|
326
|
+
: nothing}
|
|
225
327
|
</div>
|
|
226
|
-
|
|
328
|
+
`;
|
|
329
|
+
})}
|
|
227
330
|
</div>
|
|
228
331
|
`;
|
|
229
332
|
}
|
|
@@ -235,7 +338,7 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
235
338
|
const bottomRem = (minutesSinceMidnight(visibleEnd) / 60) * HOUR_HEIGHT_REM;
|
|
236
339
|
const heightRem = Math.max(bottomRem - topRem, HOUR_HEIGHT_REM / 4);
|
|
237
340
|
const widthPercent = 100 / laneCount;
|
|
238
|
-
const bodyText = [entry.label, ...(entry.details ?? [])].filter(Boolean).join("\n");
|
|
341
|
+
const bodyText = [entry.label, ...(entry.details ?? []), entry.location].filter(Boolean).join("\n");
|
|
239
342
|
return html `
|
|
240
343
|
<div
|
|
241
344
|
class="entry-bar entry-block ${entry.color}"
|
|
@@ -245,6 +348,11 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
245
348
|
>
|
|
246
349
|
${this.renderEntryLink(entry, bodyText)}
|
|
247
350
|
<span class="entry-title" aria-hidden=${entry.href ? "true" : nothing}>${entry.label}</span>
|
|
351
|
+
${entry.location
|
|
352
|
+
? html `<span class="entry-location" aria-hidden=${entry.href ? "true" : nothing}
|
|
353
|
+
>${iconMapPin(14)}${entry.location}</span
|
|
354
|
+
>`
|
|
355
|
+
: nothing}
|
|
248
356
|
</div>
|
|
249
357
|
`;
|
|
250
358
|
}
|
|
@@ -255,15 +363,17 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
255
363
|
const dayEnd = new Date(day);
|
|
256
364
|
dayEnd.setHours(23, 59, 59, 999);
|
|
257
365
|
const isToday = toIsoDate(day) === toIsoDate(new Date());
|
|
366
|
+
const isWeekendDay = isWeekend(day);
|
|
258
367
|
const resolved = this.resolveTimedEntriesFor(dayStart, dayEnd);
|
|
259
368
|
const allDay = resolved.filter((entry) => entry.allDay);
|
|
260
369
|
const timed = resolved.filter((entry) => !entry.allDay);
|
|
261
370
|
const { entries: lanedAllDay, laneCount: allDayLaneCount } = assignLanes(allDay);
|
|
262
371
|
const { entries: lanedTimed, laneCount: timedLaneCount } = assignLanes(timed);
|
|
372
|
+
const nowTopRem = this.timeMarker && isToday ? (minutesSinceMidnight(new Date(this._now)) / 60) * HOUR_HEIGHT_REM : null;
|
|
263
373
|
return html `
|
|
264
374
|
<div class="day">
|
|
265
375
|
<div class="day-header">
|
|
266
|
-
<h4 class="day-name ${isToday ? "today" : ""}">
|
|
376
|
+
<h4 class="day-name ${isWeekendDay ? "weekend" : ""} ${isToday ? "today" : ""}">
|
|
267
377
|
${monthName(day.getMonth() + 1)} ${day.getDate()}, ${day.getFullYear()}
|
|
268
378
|
</h4>
|
|
269
379
|
<div class="actions"><slot name="actions"></slot></div>
|
|
@@ -278,9 +388,12 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
278
388
|
<div class="hour-gutter">
|
|
279
389
|
${HOURS.map((h) => html `<div class="hour-label-cell">${hourLabel(h)}</div>`)}
|
|
280
390
|
</div>
|
|
281
|
-
<div class="day-column ${isToday ? "today" : ""}">
|
|
391
|
+
<div class="day-column ${isWeekendDay ? "weekend" : ""} ${isToday ? "today" : ""}">
|
|
282
392
|
${HOURS.map(() => html `<div class="hour-line"></div>`)}
|
|
283
393
|
${repeat(lanedTimed, (entry) => this.entryKey(entry), (entry) => this._renderTimedEntry(entry, Math.max(timedLaneCount, 1), dayStart, dayEnd))}
|
|
394
|
+
${nowTopRem !== null
|
|
395
|
+
? html `<div class="now-line" style="top: ${nowTopRem}rem" aria-hidden="true"></div>`
|
|
396
|
+
: nothing}
|
|
284
397
|
</div>
|
|
285
398
|
</div>
|
|
286
399
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
@@ -291,6 +404,15 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
291
404
|
__decorate([
|
|
292
405
|
property({ reflect: true })
|
|
293
406
|
], CalendarDay.prototype, "date", void 0);
|
|
407
|
+
__decorate([
|
|
408
|
+
property({ type: Boolean, reflect: true, attribute: "time-marker" })
|
|
409
|
+
], CalendarDay.prototype, "timeMarker", void 0);
|
|
410
|
+
__decorate([
|
|
411
|
+
property({ reflect: true, attribute: "min-width" })
|
|
412
|
+
], CalendarDay.prototype, "minWidth", void 0);
|
|
413
|
+
__decorate([
|
|
414
|
+
state()
|
|
415
|
+
], CalendarDay.prototype, "_now", void 0);
|
|
294
416
|
CalendarDay = __decorate([
|
|
295
417
|
customElement("calendar-day")
|
|
296
418
|
], CalendarDay);
|