@brandsync/wc 1.9.0 → 1.10.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 +4520 -3613
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/{p-c4de155c.entry.js → p-0132a2d1.entry.js} +1 -1
- package/dist/brandsync-wc/{p-051d3064.entry.js → p-041776c0.entry.js} +1 -1
- package/dist/brandsync-wc/{p-a09e157f.entry.js → p-08c99a60.entry.js} +1 -1
- package/dist/brandsync-wc/{p-70f64b25.entry.js → p-18c3c22c.entry.js} +1 -1
- package/dist/brandsync-wc/p-1c3a43c7.entry.js +1 -0
- package/dist/brandsync-wc/{p-fddc7bd1.entry.js → p-1c427ffb.entry.js} +1 -1
- package/dist/brandsync-wc/{p-29027559.entry.js → p-2e958566.entry.js} +1 -1
- package/dist/brandsync-wc/{p-235ae012.entry.js → p-301b2455.entry.js} +1 -1
- package/dist/brandsync-wc/{p-8ee0153b.entry.js → p-32cd69f1.entry.js} +1 -1
- package/dist/brandsync-wc/p-4f2c4929.entry.js +1 -0
- package/dist/brandsync-wc/{p-a0d5a620.entry.js → p-50a251a4.entry.js} +1 -1
- package/dist/brandsync-wc/{p-0e39b9cc.entry.js → p-5f3cd501.entry.js} +1 -1
- package/dist/brandsync-wc/{p-fc240aa0.entry.js → p-701ebf4a.entry.js} +1 -1
- package/dist/brandsync-wc/{p-0eed6813.entry.js → p-763876f5.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f7d47c17.entry.js → p-76e1c295.entry.js} +1 -1
- package/dist/brandsync-wc/p-790db8b3.entry.js +1 -0
- package/dist/brandsync-wc/{p-4e5dcaff.entry.js → p-796a1860.entry.js} +1 -1
- package/dist/brandsync-wc/{p-36bf37d9.entry.js → p-806a5347.entry.js} +1 -1
- package/dist/brandsync-wc/{p-6331de9c.entry.js → p-8eba7f90.entry.js} +1 -1
- package/dist/brandsync-wc/{p-6fd7dd6a.entry.js → p-96ed9386.entry.js} +1 -1
- package/dist/brandsync-wc/{p-cfcf3f0a.entry.js → p-9e88f19c.entry.js} +1 -1
- package/dist/brandsync-wc/{p-de7c946d.entry.js → p-a71d2811.entry.js} +1 -1
- package/dist/brandsync-wc/{p-33e44094.entry.js → p-a8e2a829.entry.js} +1 -1
- package/dist/brandsync-wc/{p-3b64e3cd.entry.js → p-addfa0a0.entry.js} +1 -1
- package/dist/brandsync-wc/{p-4574a707.entry.js → p-af2bf957.entry.js} +1 -1
- package/dist/brandsync-wc/{p-6bf2f116.entry.js → p-b2074a32.entry.js} +1 -1
- package/dist/brandsync-wc/{p-7c94e6ae.entry.js → p-c99b6a66.entry.js} +1 -1
- package/dist/brandsync-wc/{p-2891d40b.entry.js → p-c9a72416.entry.js} +1 -1
- package/dist/brandsync-wc/{p-9f65f998.entry.js → p-d3f44cb7.entry.js} +1 -1
- package/dist/brandsync-wc/p-d42b1c2b.entry.js +1 -0
- package/dist/brandsync-wc/{p-3ec74d35.entry.js → p-daab6b22.entry.js} +1 -1
- package/dist/brandsync-wc/{p-107b1c5d.entry.js → p-dbcbe682.entry.js} +1 -1
- package/dist/brandsync-wc/{p-3176d1d3.entry.js → p-e8a5b8eb.entry.js} +1 -1
- package/dist/brandsync-wc/{p-062cfa34.entry.js → p-ea4e20ef.entry.js} +1 -1
- package/dist/brandsync-wc/{p-27bbed83.entry.js → p-f370b8fa.entry.js} +1 -1
- package/dist/brandsync-wc/{p-05c7de28.entry.js → p-f89de457.entry.js} +1 -1
- package/dist/brandsync-wc/{p-114d2fd8.entry.js → p-fd254972.entry.js} +1 -1
- package/dist/cjs/brandsync-wc.cjs.js +1 -1
- package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +1 -1
- package/dist/cjs/bs-ai-greeting.cjs.entry.js +1 -1
- package/dist/cjs/bs-ai-thinking.cjs.entry.js +1 -1
- package/dist/cjs/bs-attachment-list.cjs.entry.js +1 -1
- package/dist/cjs/bs-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/bs-button-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-feedback.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-header.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +1 -1
- package/dist/cjs/bs-checkbox-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/bs-datepicker.cjs.entry.js +410 -0
- package/dist/cjs/bs-file-upload-item.cjs.entry.js +1 -1
- package/dist/cjs/bs-file-upload.cjs.entry.js +1 -1
- package/dist/cjs/bs-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/bs-inline-tab.cjs.entry.js +1 -1
- package/dist/cjs/{bs-input.cjs.entry.js → bs-input_2.cjs.entry.js} +37 -4
- package/dist/cjs/bs-menu.cjs.entry.js +1 -1
- package/dist/cjs/bs-navigation-drawer-item.cjs.entry.js +1 -1
- package/dist/cjs/bs-navigation-drawer.cjs.entry.js +2 -2
- package/dist/cjs/bs-navigation-header.cjs.entry.js +1 -1
- package/dist/cjs/bs-pagination.cjs.entry.js +1 -1
- package/dist/cjs/bs-progress-linear.cjs.entry.js +2 -2
- package/dist/cjs/bs-progress.cjs.entry.js +2 -2
- package/dist/cjs/bs-radio.cjs.entry.js +1 -1
- package/dist/cjs/bs-slider.cjs.entry.js +1 -1
- package/dist/cjs/bs-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/bs-source-link.cjs.entry.js +2 -2
- package/dist/cjs/bs-stepper-step.cjs.entry.js +1 -1
- package/dist/cjs/bs-stepper.cjs.entry.js +1 -1
- package/dist/cjs/bs-switch.cjs.entry.js +1 -1
- package/dist/cjs/bs-tab.cjs.entry.js +1 -1
- package/dist/cjs/bs-tabs.cjs.entry.js +1 -1
- package/dist/cjs/bs-timepicker.cjs.entry.js +209 -0
- package/dist/cjs/bs-toast.cjs.entry.js +1 -1
- package/dist/cjs/bs-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/bs-a11y.cmp.test.js +4 -0
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.js +1 -1
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.js +1 -1
- package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.js +1 -1
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.js +1 -1
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumbs/bs-breadcrumbs.js +1 -1
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.js +1 -1
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +1 -1
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.js +1 -1
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.js +1 -1
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +1 -1
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.js +1 -1
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js +1 -1
- package/dist/collection/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.js +1 -1
- package/dist/collection/components/bs-datepicker/bs-datepicker.cmp.test.js +182 -0
- package/dist/collection/components/bs-datepicker/bs-datepicker.css +315 -0
- package/dist/collection/components/bs-datepicker/bs-datepicker.js +782 -0
- package/dist/collection/components/bs-datepicker/bs-datepicker.stories.js +63 -0
- package/dist/collection/components/bs-file-upload/bs-file-upload.js +1 -1
- package/dist/collection/components/bs-file-upload-item/bs-file-upload-item.js +1 -1
- package/dist/collection/components/bs-input/bs-input.js +7 -4
- package/dist/collection/components/bs-menu/bs-menu.js +1 -1
- package/dist/collection/components/bs-menu-item/bs-menu-item.js +1 -1
- package/dist/collection/components/bs-pagination/bs-pagination.js +1 -1
- package/dist/collection/components/bs-progress/bs-progress.js +2 -2
- package/dist/collection/components/bs-progress-linear/bs-progress-linear.js +2 -2
- package/dist/collection/components/bs-radio/bs-radio.js +1 -1
- package/dist/collection/components/bs-slider/bs-slider.js +1 -1
- package/dist/collection/components/bs-snackbar/bs-snackbar.js +1 -1
- package/dist/collection/components/bs-source-link/bs-source-link.js +2 -2
- package/dist/collection/components/bs-stepper/bs-stepper/bs-stepper.js +1 -1
- package/dist/collection/components/bs-stepper/bs-stepper-step/bs-stepper-step.js +1 -1
- package/dist/collection/components/bs-switch/bs-switch.js +1 -1
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.js +1 -1
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.js +1 -1
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.js +1 -1
- package/dist/collection/components/bs-timepicker/bs-timepicker.cmp.test.js +141 -0
- package/dist/collection/components/bs-timepicker/bs-timepicker.css +200 -0
- package/dist/collection/components/bs-timepicker/bs-timepicker.js +509 -0
- package/dist/collection/components/bs-timepicker/bs-timepicker.stories.js +44 -0
- package/dist/collection/components/bs-toast/bs-toast.js +1 -1
- package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.js +2 -2
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.js +1 -1
- package/dist/components/bs-ai-disclaimer.js +1 -1
- package/dist/components/bs-ai-greeting.js +1 -1
- package/dist/components/bs-ai-thinking.js +1 -1
- package/dist/components/bs-attachment-list.js +1 -1
- package/dist/components/bs-attachment.js +1 -1
- package/dist/components/bs-breadcrumb-overflow.js +1 -1
- package/dist/components/bs-breadcrumbs.js +1 -1
- package/dist/components/bs-button-skeleton.js +1 -1
- package/dist/components/bs-carousel.js +1 -1
- package/dist/components/bs-chatbot-feedback.js +1 -1
- package/dist/components/bs-chatbot-header.js +1 -1
- package/dist/components/bs-chatbot-response-action.js +1 -1
- package/dist/components/bs-chatbot-sources-drawer.js +1 -1
- package/dist/components/bs-chatbot-suggestion-button.js +1 -1
- package/dist/components/bs-checkbox-skeleton.js +1 -1
- package/dist/components/bs-datepicker.d.ts +11 -0
- package/dist/components/bs-datepicker.js +1 -0
- package/dist/components/bs-dialog.js +1 -1
- package/dist/components/bs-file-upload-item.js +1 -1
- package/dist/components/bs-file-upload.js +1 -1
- package/dist/components/bs-icon-button.js +1 -1
- package/dist/components/bs-inline-tab.js +1 -1
- package/dist/components/bs-input.js +1 -1
- package/dist/components/bs-menu-item.js +1 -1
- package/dist/components/bs-menu.js +1 -1
- package/dist/components/bs-navigation-drawer-item.js +1 -1
- package/dist/components/bs-navigation-drawer.js +1 -1
- package/dist/components/bs-navigation-header.js +1 -1
- package/dist/components/bs-pagination.js +1 -1
- package/dist/components/bs-progress-linear.js +1 -1
- package/dist/components/bs-progress.js +1 -1
- package/dist/components/bs-radio.js +1 -1
- package/dist/components/bs-slider.js +1 -1
- package/dist/components/bs-snackbar.js +1 -1
- package/dist/components/bs-source-link.js +1 -1
- package/dist/components/bs-stepper-step.js +1 -1
- package/dist/components/bs-stepper.js +1 -1
- package/dist/components/bs-switch.js +1 -1
- package/dist/components/bs-tab.js +1 -1
- package/dist/components/bs-tabs.js +1 -1
- package/dist/components/bs-timepicker.d.ts +11 -0
- package/dist/components/bs-timepicker.js +1 -0
- package/dist/components/bs-toast.js +1 -1
- package/dist/components/bs-tooltip.js +1 -1
- package/dist/components/{p-BA3c9Rom.js → p-B7Icv1ho.js} +1 -1
- package/dist/components/{p-wei0Ija2.js → p-BTvme8CE.js} +1 -1
- package/dist/components/{p-BoeorHNv.js → p-BYR_ZC8v.js} +1 -1
- package/dist/components/p-Ba860ej1.js +1 -0
- package/dist/components/p-CPvqZNO8.js +1 -0
- package/dist/components/{p-EtXc94lJ.js → p-DkIVyFOP.js} +1 -1
- package/dist/components/{p-BfEyD6Ku.js → p-ZK8p5zax.js} +1 -1
- package/dist/components/p-jDO25SfF.js +1 -0
- package/dist/esm/brandsync-wc.js +1 -1
- package/dist/esm/bs-ai-disclaimer.entry.js +1 -1
- package/dist/esm/bs-ai-greeting.entry.js +1 -1
- package/dist/esm/bs-ai-thinking.entry.js +1 -1
- package/dist/esm/bs-attachment-list.entry.js +1 -1
- package/dist/esm/bs-breadcrumbs.entry.js +1 -1
- package/dist/esm/bs-button-skeleton.entry.js +1 -1
- package/dist/esm/bs-chatbot-feedback.entry.js +1 -1
- package/dist/esm/bs-chatbot-header.entry.js +1 -1
- package/dist/esm/bs-chatbot-response-action.entry.js +1 -1
- package/dist/esm/bs-chatbot-sources-drawer.entry.js +1 -1
- package/dist/esm/bs-chatbot-suggestion-button.entry.js +1 -1
- package/dist/esm/bs-checkbox-skeleton.entry.js +1 -1
- package/dist/esm/bs-datepicker.entry.js +408 -0
- package/dist/esm/bs-file-upload-item.entry.js +1 -1
- package/dist/esm/bs-file-upload.entry.js +1 -1
- package/dist/esm/bs-icon-button.entry.js +1 -1
- package/dist/esm/bs-inline-tab.entry.js +1 -1
- package/dist/esm/{bs-input.entry.js → bs-input_2.entry.js} +37 -5
- package/dist/esm/bs-menu.entry.js +1 -1
- package/dist/esm/bs-navigation-drawer-item.entry.js +1 -1
- package/dist/esm/bs-navigation-drawer.entry.js +2 -2
- package/dist/esm/bs-navigation-header.entry.js +1 -1
- package/dist/esm/bs-pagination.entry.js +1 -1
- package/dist/esm/bs-progress-linear.entry.js +2 -2
- package/dist/esm/bs-progress.entry.js +2 -2
- package/dist/esm/bs-radio.entry.js +1 -1
- package/dist/esm/bs-slider.entry.js +1 -1
- package/dist/esm/bs-snackbar.entry.js +1 -1
- package/dist/esm/bs-source-link.entry.js +2 -2
- package/dist/esm/bs-stepper-step.entry.js +1 -1
- package/dist/esm/bs-stepper.entry.js +1 -1
- package/dist/esm/bs-switch.entry.js +1 -1
- package/dist/esm/bs-tab.entry.js +1 -1
- package/dist/esm/bs-tabs.entry.js +1 -1
- package/dist/esm/bs-timepicker.entry.js +207 -0
- package/dist/esm/bs-toast.entry.js +1 -1
- package/dist/esm/bs-tooltip.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/bs-datepicker/bs-datepicker.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-datepicker/bs-datepicker.d.ts +136 -0
- package/dist/types/components/bs-datepicker/bs-datepicker.stories.d.ts +20 -0
- package/dist/types/components/bs-timepicker/bs-timepicker.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-timepicker/bs-timepicker.d.ts +101 -0
- package/dist/types/components/bs-timepicker/bs-timepicker.stories.d.ts +14 -0
- package/dist/types/components.d.ts +515 -0
- package/package.json +1 -1
- package/dist/brandsync-wc/p-7b00dd36.entry.js +0 -1
- package/dist/brandsync-wc/p-ae978c9a.entry.js +0 -1
- package/dist/brandsync-wc/p-c10d2529.entry.js +0 -1
- package/dist/cjs/bs-menu-item.cjs.entry.js +0 -34
- package/dist/components/p-Buly0d5G.js +0 -1
- package/dist/esm/bs-menu-item.entry.js +0 -32
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-kk9YXF2S.js');
|
|
4
|
+
|
|
5
|
+
const bsDatepickerCss = () => `:host{display:inline-block;--bs-datepicker-width:364px;--bs-datepicker-bg:var(--bs-surface-raised);--bs-datepicker-radius:var(--bs-border-radius-150);--bs-datepicker-padding:var(--bs-spacing-200);--bs-datepicker-gap:var(--bs-spacing-150);--bs-datepicker-shadow:var(--bs-shadow-md);--bs-datepicker-menu-max-height:280px;--bs-datepicker-day-size:var(--bs-spacing-550);--bs-datepicker-day-radius:var(--bs-border-radius-100);--bs-datepicker-day-gap:var(--bs-spacing-50);--bs-datepicker-band-bridge:var(--bs-spacing-50);--bs-datepicker-font-size:var(--bs-font-size-md);--bs-datepicker-line-height:var(--bs-line-height-body-md);--bs-datepicker-weekday-font-size:var(--bs-font-size-sm);--bs-datepicker-weekday-line-height:var(--bs-line-height-body-sm);--bs-datepicker-color:var(--bs-text-default);--bs-datepicker-color-muted:var(--bs-text-muted);--bs-datepicker-color-weekday:var(--bs-text-secondary);--bs-datepicker-color-disabled:var(--bs-text-on-disabled);--bs-datepicker-hover:var(--bs-surface-hover);--bs-datepicker-pressed:var(--bs-surface-pressed);--bs-datepicker-focus-bg:var(--bs-surface-focus);--bs-datepicker-selected-bg:var(--bs-color-primary-default);--bs-datepicker-selected-bg-hover:var(--bs-color-primary-hover);--bs-datepicker-selected-bg-pressed:var(--bs-color-primary-pressed);--bs-datepicker-selected-bg-focus:var(--bs-color-primary-focused);--bs-datepicker-selected-bg-disabled:var(--bs-surface-action-disabled);--bs-datepicker-selected-color:var(--bs-text-on-action);--bs-datepicker-range-bg:var(--bs-color-primary-container);--bs-datepicker-today-border:var(--bs-border-primary);--bs-datepicker-focus-ring-color:var(--bs-border-neutral-focus)}.bs-datepicker{box-sizing:border-box;display:flex;flex-direction:column;gap:var(--bs-datepicker-gap);width:var(--bs-datepicker-width);max-width:100%;padding:var(--bs-datepicker-padding);border-radius:var(--bs-datepicker-radius);background:var(--bs-datepicker-bg);box-shadow:var(--bs-datepicker-shadow);color:var(--bs-datepicker-color);font-family:inherit;font-size:var(--bs-datepicker-font-size)}.bs-datepicker__header{display:flex;align-items:flex-start;gap:var(--bs-spacing-100)}.bs-datepicker__header>bs-input{flex:1 1 0;min-width:0}.bs-datepicker__select::part(label){position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.bs-datepicker__dropdown{position:relative;flex:1 1 0;min-width:0}.bs-datepicker__dropdown bs-input{width:100%}.bs-datepicker__menu{position:absolute;top:calc(100% + var(--bs-spacing-50));inset-inline:0;z-index:2;max-height:var(--bs-datepicker-menu-max-height);overflow-y:auto;border-radius:var(--bs-border-radius-100);background:var(--bs-surface-raised);box-shadow:var(--bs-shadow-md);--bs-menu-shadow:none}.bs-datepicker__menu bs-menu-item{--bs-menu-item-color:var(--bs-datepicker-color)}.bs-datepicker__menu bs-menu-item::part(label){flex:1;text-align:start}.bs-datepicker__option{display:flex;align-items:center;justify-content:space-between;gap:var(--bs-spacing-100)}.bs-datepicker__option svg{width:20px;height:20px;flex:none}.bs-datepicker__nav{display:flex;align-items:center;justify-content:space-between}.bs-datepicker__title{font-weight:var(--bs-font-weight-semibold);line-height:calc(var(--bs-datepicker-line-height) * 1px)}.bs-datepicker__nav-button{display:flex;align-items:center;justify-content:center;width:var(--bs-spacing-600);height:var(--bs-spacing-600);padding:0;border:none;border-radius:var(--bs-datepicker-day-radius);background:transparent;color:var(--bs-icon-default);cursor:pointer}.bs-datepicker__nav-button svg{width:24px;height:24px}.bs-datepicker__nav-button:hover{background:var(--bs-datepicker-hover)}.bs-datepicker__grid{display:flex;flex-direction:column;gap:var(--bs-datepicker-day-gap)}.bs-datepicker__row{display:grid;grid-template-columns:repeat(7, var(--bs-datepicker-day-size));justify-content:space-between}.bs-datepicker__weekday{display:flex;align-items:center;justify-content:center;height:var(--bs-datepicker-day-size);color:var(--bs-datepicker-color-weekday);font-size:var(--bs-datepicker-weekday-font-size);font-weight:var(--bs-font-weight-semibold);line-height:calc(var(--bs-datepicker-weekday-line-height) * 1px)}.bs-datepicker__cell{display:flex;justify-content:center}.bs-datepicker__cell--in-range{background:var(--bs-datepicker-range-bg);box-shadow:calc(var(--bs-datepicker-band-bridge) + 1px) 0 0 var(--bs-datepicker-range-bg)}.bs-datepicker__cell--band-start{border-start-start-radius:var(--bs-datepicker-day-radius);border-end-start-radius:var(--bs-datepicker-day-radius)}.bs-datepicker__cell--band-end{border-start-end-radius:var(--bs-datepicker-day-radius);border-end-end-radius:var(--bs-datepicker-day-radius);box-shadow:none}.bs-datepicker__day{width:var(--bs-datepicker-day-size);height:var(--bs-datepicker-day-size);padding:0;border:none;border-radius:var(--bs-datepicker-day-radius);background:transparent;color:var(--bs-datepicker-color);font-family:inherit;font-size:var(--bs-datepicker-font-size);line-height:calc(var(--bs-datepicker-line-height) * 1px);cursor:pointer}.bs-datepicker__day--outside{color:var(--bs-datepicker-color-muted)}.bs-datepicker__day--today{box-shadow:inset 0 0 0 1px var(--bs-datepicker-today-border)}.bs-datepicker__day:not(:disabled):hover{background:var(--bs-datepicker-hover)}.bs-datepicker__day:not(:disabled):active{background:var(--bs-datepicker-pressed)}.bs-datepicker__day--in-range:not(:disabled):hover,.bs-datepicker__day--in-range:not(:disabled):active{background:var(--bs-datepicker-range-bg)}.bs-datepicker__day--selected,.bs-datepicker__day--selected.bs-datepicker__day--outside{background:var(--bs-datepicker-selected-bg);color:var(--bs-datepicker-selected-color)}.bs-datepicker__day--selected:not(:disabled):hover{background:var(--bs-datepicker-selected-bg-hover)}.bs-datepicker__day--selected:not(:disabled):active{background:var(--bs-datepicker-selected-bg-pressed)}.bs-datepicker__day:disabled{color:var(--bs-datepicker-color-disabled);cursor:not-allowed}.bs-datepicker__day--selected:disabled{background:var(--bs-datepicker-selected-bg-disabled)}.bs-datepicker__day:focus-visible{background:var(--bs-datepicker-focus-bg);outline:2px solid var(--bs-datepicker-focus-ring-color);outline-offset:0}.bs-datepicker__day--selected:focus-visible{background:var(--bs-datepicker-selected-bg-focus)}.bs-datepicker__nav-button:focus-visible{outline:2px solid var(--bs-datepicker-focus-ring-color);outline-offset:2px}`;
|
|
6
|
+
|
|
7
|
+
const BsDatepicker = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.bsChange = index.createEvent(this, "bsChange");
|
|
11
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
12
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
16
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
get el() { return index.getElement(this); }
|
|
20
|
+
internals;
|
|
21
|
+
initialValue = '';
|
|
22
|
+
initialStart = '';
|
|
23
|
+
initialEnd = '';
|
|
24
|
+
/** The `name` the value is submitted under in a surrounding `<form>`. In `range` mode the dates
|
|
25
|
+
* are submitted as `<name>-start` and `<name>-end`. */
|
|
26
|
+
name;
|
|
27
|
+
/** Select a start/end range instead of a single date. */
|
|
28
|
+
range = false;
|
|
29
|
+
/** The selected date (`YYYY-MM-DD`) in single mode. Mutable so a click updates it directly;
|
|
30
|
+
* `bsChange` still fires for the consumer to react. Ignored when `range` is set. */
|
|
31
|
+
value = '';
|
|
32
|
+
/** The range start (`YYYY-MM-DD`) in `range` mode. */
|
|
33
|
+
start = '';
|
|
34
|
+
/** The range end (`YYYY-MM-DD`) in `range` mode. */
|
|
35
|
+
end = '';
|
|
36
|
+
/** Earliest selectable date (`YYYY-MM-DD`). Earlier days render disabled. */
|
|
37
|
+
min;
|
|
38
|
+
/** Latest selectable date (`YYYY-MM-DD`). Later days render disabled. */
|
|
39
|
+
max;
|
|
40
|
+
/** BCP 47 locale used for month names, weekday names and the title. */
|
|
41
|
+
locale = 'en-GB';
|
|
42
|
+
/** First column of the grid: `0` for Sunday (the Figma spec), `1` for Monday, ... `6`. */
|
|
43
|
+
firstDayOfWeek = 0;
|
|
44
|
+
/** Label above the start field in `range` mode. */
|
|
45
|
+
startLabel = 'Start date';
|
|
46
|
+
/** Label above the end field in `range` mode. */
|
|
47
|
+
endLabel = 'End date';
|
|
48
|
+
/** Accessible name for the month dropdown (single mode). */
|
|
49
|
+
monthLabel = 'Month';
|
|
50
|
+
/** Accessible name for the year dropdown (single mode). */
|
|
51
|
+
yearLabel = 'Year';
|
|
52
|
+
/** Accessible name for the previous-month button. */
|
|
53
|
+
previousLabel = 'Previous month';
|
|
54
|
+
/** Accessible name for the next-month button. */
|
|
55
|
+
nextLabel = 'Next month';
|
|
56
|
+
/** Fires when the user changes the selection. Single mode: `{ value }`. Range mode: `{ start,
|
|
57
|
+
* end }` -- fired once for the first click (with an empty `end`) and again when the range is
|
|
58
|
+
* completed. Not fired when the props are set programmatically. */
|
|
59
|
+
bsChange;
|
|
60
|
+
/** First day of the month currently displayed. */
|
|
61
|
+
viewDate = firstOfMonth(new Date());
|
|
62
|
+
/** The day holding the roving tabindex. */
|
|
63
|
+
focusedIso = '';
|
|
64
|
+
/** The day the pointer is over while a range is half-picked, for the live range preview. */
|
|
65
|
+
hoverIso = '';
|
|
66
|
+
/** Text the user is typing into a range field, keyed by which field. Cleared on commit. */
|
|
67
|
+
draft = {};
|
|
68
|
+
/** Which header dropdown (single mode) is open. */
|
|
69
|
+
openMenu = null;
|
|
70
|
+
shouldFocusDay = false;
|
|
71
|
+
menuToScroll = false;
|
|
72
|
+
componentWillLoad() {
|
|
73
|
+
this.initialValue = this.value;
|
|
74
|
+
this.initialStart = this.start;
|
|
75
|
+
this.initialEnd = this.end;
|
|
76
|
+
this.showSelection();
|
|
77
|
+
this.syncFormValue();
|
|
78
|
+
}
|
|
79
|
+
componentDidRender() {
|
|
80
|
+
if (this.menuToScroll) {
|
|
81
|
+
this.menuToScroll = false;
|
|
82
|
+
// Centre the current month/year in the list. Done by hand rather than scrollIntoView, which
|
|
83
|
+
// would also scroll the page.
|
|
84
|
+
const menu = this.el.shadowRoot.querySelector('.bs-datepicker__menu');
|
|
85
|
+
const current = menu?.querySelector('[data-current]');
|
|
86
|
+
if (menu && current)
|
|
87
|
+
menu.scrollTop = current.offsetTop - menu.clientHeight / 2 + current.offsetHeight / 2;
|
|
88
|
+
}
|
|
89
|
+
if (!this.shouldFocusDay)
|
|
90
|
+
return;
|
|
91
|
+
this.shouldFocusDay = false;
|
|
92
|
+
const day = this.el.shadowRoot.querySelector(`[data-date="${this.focusedIso}"]`);
|
|
93
|
+
day?.focus();
|
|
94
|
+
}
|
|
95
|
+
onSelectionChange() {
|
|
96
|
+
this.syncFormValue();
|
|
97
|
+
}
|
|
98
|
+
onSelectionJump() {
|
|
99
|
+
// A programmatic change should bring the new selection into view.
|
|
100
|
+
this.showSelection();
|
|
101
|
+
}
|
|
102
|
+
/** Called by the browser when the surrounding `<form>` is reset. */
|
|
103
|
+
formResetCallback() {
|
|
104
|
+
this.value = this.initialValue;
|
|
105
|
+
this.start = this.initialStart;
|
|
106
|
+
this.end = this.initialEnd;
|
|
107
|
+
this.draft = {};
|
|
108
|
+
}
|
|
109
|
+
showSelection() {
|
|
110
|
+
const anchor = parseIso(this.range ? this.start : this.value);
|
|
111
|
+
if (anchor)
|
|
112
|
+
this.viewDate = firstOfMonth(anchor);
|
|
113
|
+
}
|
|
114
|
+
syncFormValue() {
|
|
115
|
+
if (!this.internals?.setFormValue)
|
|
116
|
+
return;
|
|
117
|
+
if (this.range) {
|
|
118
|
+
if (!this.name) {
|
|
119
|
+
this.internals.setFormValue(null);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const data = new FormData();
|
|
123
|
+
data.append(`${this.name}-start`, this.start ?? '');
|
|
124
|
+
data.append(`${this.name}-end`, this.end ?? '');
|
|
125
|
+
this.internals.setFormValue(data);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
this.internals.setFormValue(this.value ?? '');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// --- selection ---------------------------------------------------------------------------
|
|
132
|
+
isDisabled(d) {
|
|
133
|
+
const min = parseIso(this.min);
|
|
134
|
+
const max = parseIso(this.max);
|
|
135
|
+
return (!!min && d < min) || (!!max && d > max);
|
|
136
|
+
}
|
|
137
|
+
selectDay(d) {
|
|
138
|
+
if (this.isDisabled(d))
|
|
139
|
+
return;
|
|
140
|
+
const iso = toIso(d);
|
|
141
|
+
if (d.getMonth() !== this.viewDate.getMonth() || d.getFullYear() !== this.viewDate.getFullYear()) {
|
|
142
|
+
this.viewDate = firstOfMonth(d);
|
|
143
|
+
}
|
|
144
|
+
this.focusedIso = iso;
|
|
145
|
+
if (!this.range) {
|
|
146
|
+
this.value = iso;
|
|
147
|
+
this.bsChange.emit({ value: iso });
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
// First click, or a click after a completed range, starts a new range. A click before the
|
|
151
|
+
// current start restarts from there rather than producing a backwards range.
|
|
152
|
+
if (!this.start || this.end || iso < this.start) {
|
|
153
|
+
this.start = iso;
|
|
154
|
+
this.end = '';
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
this.end = iso;
|
|
158
|
+
}
|
|
159
|
+
this.hoverIso = '';
|
|
160
|
+
this.draft = {};
|
|
161
|
+
this.bsChange.emit({ start: this.start, end: this.end });
|
|
162
|
+
}
|
|
163
|
+
commitDraft(field) {
|
|
164
|
+
const text = this.draft[field];
|
|
165
|
+
if (text === undefined)
|
|
166
|
+
return;
|
|
167
|
+
const d = parseIso(text);
|
|
168
|
+
const next = { ...this.draft };
|
|
169
|
+
delete next[field];
|
|
170
|
+
this.draft = next;
|
|
171
|
+
if (!d || this.isDisabled(d))
|
|
172
|
+
return; // invalid text: fall back to the committed value
|
|
173
|
+
let start = field === 'start' ? toIso(d) : this.start;
|
|
174
|
+
let end = field === 'end' ? toIso(d) : this.end;
|
|
175
|
+
if (start && end && end < start) {
|
|
176
|
+
if (field === 'start')
|
|
177
|
+
end = '';
|
|
178
|
+
else
|
|
179
|
+
start = '';
|
|
180
|
+
}
|
|
181
|
+
this.start = start;
|
|
182
|
+
this.end = end;
|
|
183
|
+
this.showSelection();
|
|
184
|
+
this.bsChange.emit({ start, end });
|
|
185
|
+
}
|
|
186
|
+
// --- navigation --------------------------------------------------------------------------
|
|
187
|
+
moveView(months) {
|
|
188
|
+
const v = this.viewDate;
|
|
189
|
+
this.viewDate = new Date(v.getFullYear(), v.getMonth() + months, 1);
|
|
190
|
+
}
|
|
191
|
+
onKeyDown = (ev, current) => {
|
|
192
|
+
const step = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -7, ArrowDown: 7 };
|
|
193
|
+
let next;
|
|
194
|
+
if (ev.key in step) {
|
|
195
|
+
next = addDays(current, step[ev.key]);
|
|
196
|
+
}
|
|
197
|
+
else if (ev.key === 'Home' || ev.key === 'End') {
|
|
198
|
+
const col = (current.getDay() - this.safeFirstDay + 7) % 7;
|
|
199
|
+
next = addDays(current, ev.key === 'Home' ? -col : 6 - col);
|
|
200
|
+
}
|
|
201
|
+
else if (ev.key === 'PageUp' || ev.key === 'PageDown') {
|
|
202
|
+
const dir = ev.key === 'PageUp' ? -1 : 1;
|
|
203
|
+
next = addMonths(current, ev.shiftKey ? dir * 12 : dir);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
ev.preventDefault();
|
|
209
|
+
this.focusedIso = toIso(next);
|
|
210
|
+
this.viewDate = firstOfMonth(next);
|
|
211
|
+
this.shouldFocusDay = true;
|
|
212
|
+
};
|
|
213
|
+
get safeFirstDay() {
|
|
214
|
+
const n = Math.trunc(Number(this.firstDayOfWeek));
|
|
215
|
+
return Number.isFinite(n) ? ((n % 7) + 7) % 7 : 0;
|
|
216
|
+
}
|
|
217
|
+
// --- rendering ---------------------------------------------------------------------------
|
|
218
|
+
get fmt() {
|
|
219
|
+
const locale = this.locale || 'en-GB';
|
|
220
|
+
try {
|
|
221
|
+
return locale;
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
return 'en-GB';
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
formatField(iso) {
|
|
228
|
+
const d = parseIso(iso);
|
|
229
|
+
return d ? new Intl.DateTimeFormat(this.fmt, { day: 'numeric', month: 'short', year: 'numeric' }).format(d) : '';
|
|
230
|
+
}
|
|
231
|
+
titleText() {
|
|
232
|
+
const selected = !this.range ? parseIso(this.value) : undefined;
|
|
233
|
+
if (selected) {
|
|
234
|
+
return new Intl.DateTimeFormat(this.fmt, { day: 'numeric', month: 'long', year: 'numeric' }).format(selected);
|
|
235
|
+
}
|
|
236
|
+
return new Intl.DateTimeFormat(this.fmt, { month: 'long', year: 'numeric' }).format(this.viewDate);
|
|
237
|
+
}
|
|
238
|
+
monthOptions() {
|
|
239
|
+
const f = new Intl.DateTimeFormat(this.fmt, { month: 'long' });
|
|
240
|
+
return Array.from({ length: 12 }, (_, m) => ({ label: f.format(new Date(2000, m, 1)), value: String(m) }));
|
|
241
|
+
}
|
|
242
|
+
yearOptions() {
|
|
243
|
+
const current = this.viewDate.getFullYear();
|
|
244
|
+
const min = parseIso(this.min)?.getFullYear() ?? current - 100;
|
|
245
|
+
const max = parseIso(this.max)?.getFullYear() ?? current + 100;
|
|
246
|
+
const options = [];
|
|
247
|
+
for (let y = Math.min(min, current); y <= Math.max(max, current); y++) {
|
|
248
|
+
options.push({ label: String(y), value: String(y) });
|
|
249
|
+
}
|
|
250
|
+
return options;
|
|
251
|
+
}
|
|
252
|
+
weekdays() {
|
|
253
|
+
const f = new Intl.DateTimeFormat(this.fmt, { weekday: 'short' });
|
|
254
|
+
// 2023-01-01 was a Sunday.
|
|
255
|
+
return Array.from({ length: 7 }, (_, i) => f.format(new Date(2023, 0, 1 + ((this.safeFirstDay + i) % 7))));
|
|
256
|
+
}
|
|
257
|
+
gridDays() {
|
|
258
|
+
const first = this.viewDate;
|
|
259
|
+
const lead = (first.getDay() - this.safeFirstDay + 7) % 7;
|
|
260
|
+
const gridStart = addDays(first, -lead);
|
|
261
|
+
// Always 6 rows, so the card doesn't change height from month to month (as in the Figma).
|
|
262
|
+
return Array.from({ length: 42 }, (_, i) => addDays(gridStart, i));
|
|
263
|
+
}
|
|
264
|
+
renderHeader() {
|
|
265
|
+
if (this.range) {
|
|
266
|
+
const field = (which, label) => (index.h("bs-input", { label: label, placeholder: "YYYY-MM-DD", value: this.draft[which] ?? this.formatField(this[which]), onBsInput: (ev) => (this.draft = { ...this.draft, [which]: ev.detail }), onBsChange: () => this.commitDraft(which), onFocusin: () => {
|
|
267
|
+
// Typing is ISO: swap the pretty "12 Sept, 2026" for something parseable on focus.
|
|
268
|
+
if (this.draft[which] === undefined)
|
|
269
|
+
this.draft = { ...this.draft, [which]: this[which] };
|
|
270
|
+
}, onFocusout: () => this.commitDraft(which) }));
|
|
271
|
+
return (index.h("div", { part: "header", class: "bs-datepicker__header bs-datepicker__header--range" }, field('start', this.startLabel), field('end', this.endLabel)));
|
|
272
|
+
}
|
|
273
|
+
return (index.h("div", { part: "header", class: "bs-datepicker__header" }, this.renderDropdown('month', this.monthLabel, this.monthOptions(), String(this.viewDate.getMonth()), (value) => (this.viewDate = new Date(this.viewDate.getFullYear(), Number(value), 1))), this.renderDropdown('year', this.yearLabel, this.yearOptions(), String(this.viewDate.getFullYear()), (value) => (this.viewDate = new Date(Number(value), this.viewDate.getMonth(), 1)))));
|
|
274
|
+
}
|
|
275
|
+
/** A `bs-input type="dropdown"` trigger with our own `bs-menu` list below it. bs-input's built-in
|
|
276
|
+
* menu has no checkmark or scroll limit, so it's used only as the field look: it gets no
|
|
277
|
+
* `options` (so renders no menu of its own) and its `bsOpen` toggles ours. */
|
|
278
|
+
renderDropdown(which, label, options, current, onPick) {
|
|
279
|
+
const open = this.openMenu === which;
|
|
280
|
+
const close = () => {
|
|
281
|
+
this.openMenu = null;
|
|
282
|
+
};
|
|
283
|
+
return (index.h("div", { class: "bs-datepicker__dropdown", onKeyDown: (ev) => {
|
|
284
|
+
if (ev.key !== 'Escape' || !open)
|
|
285
|
+
return;
|
|
286
|
+
close();
|
|
287
|
+
ev.currentTarget.querySelector('bs-input')?.focus();
|
|
288
|
+
}, onFocusout: (ev) => {
|
|
289
|
+
const related = ev.relatedTarget;
|
|
290
|
+
if (open && (!related || !ev.currentTarget.contains(related)))
|
|
291
|
+
close();
|
|
292
|
+
} }, index.h("bs-input", { type: "dropdown", class: "bs-datepicker__select", label: label, value: options.find(o => o.value === current)?.label ?? '', open: open, onBsOpen: () => {
|
|
293
|
+
this.menuToScroll = !open;
|
|
294
|
+
this.openMenu = open ? null : which;
|
|
295
|
+
} }), open && (index.h("bs-menu", { part: "menu", class: "bs-datepicker__menu", role: "listbox" }, options.map(o => (index.h("bs-menu-item", { key: o.value, "data-current": o.value === current ? '' : undefined, "aria-current": o.value === current ? 'true' : undefined, onBsSelect: () => {
|
|
296
|
+
onPick(o.value);
|
|
297
|
+
close();
|
|
298
|
+
this.el.shadowRoot.querySelector(`.bs-datepicker__dropdown bs-input[label="${label}"]`)?.focus();
|
|
299
|
+
} }, index.h("span", { class: "bs-datepicker__option" }, index.h("span", null, o.label), o.value === current && (index.h("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true" }, index.h("path", { d: "M5 12.5L10 17.5L19 7.5", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })))))))))));
|
|
300
|
+
}
|
|
301
|
+
render() {
|
|
302
|
+
const days = this.gridDays();
|
|
303
|
+
const todayIso = toIso(new Date());
|
|
304
|
+
const selectedStart = this.range ? this.start : this.value;
|
|
305
|
+
const selectedEnd = this.range ? this.end : '';
|
|
306
|
+
// While the range is half-picked, preview it up to the hovered day.
|
|
307
|
+
const previewEnd = this.range && this.start && !this.end && this.hoverIso > this.start ? this.hoverIso : selectedEnd;
|
|
308
|
+
const tabbable = days.some(d => toIso(d) === this.focusedIso && d.getMonth() === this.viewDate.getMonth())
|
|
309
|
+
? this.focusedIso
|
|
310
|
+
: this.defaultTabbable(days);
|
|
311
|
+
const isInRange = (iso) => !!selectedStart && !!previewEnd && iso > selectedStart && iso < previewEnd;
|
|
312
|
+
const weekdays = this.weekdays();
|
|
313
|
+
return (index.h("div", { key: '49e2ce73c32ee98eb2c8276fb23b159392b9292a', part: "container", class: "bs-datepicker" }, this.renderHeader(), index.h("div", { key: 'da69881edff77ee3584b4565a4b39024ce2cd4f7', part: "nav", class: "bs-datepicker__nav" }, index.h("button", { key: 'f96dea3cc2821bf757afcee158c092deefe45b8b', part: "prev", type: "button", class: "bs-datepicker__nav-button", "aria-label": this.previousLabel, onClick: () => this.moveView(-1) }, index.h("svg", { key: '7be3e0ca1588852357d13ade50f594633f86a56a', viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true" }, index.h("path", { key: '513165ad97411656af1742376cf7d75eda544814', d: "M15 18L9 12L15 6", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))), index.h("div", { key: 'bc55234eb1bd053c87388e7d6ebe31049f903cea', part: "title", class: "bs-datepicker__title", "aria-live": "polite" }, this.titleText()), index.h("button", { key: '2436e91d78710f7d0716553660c8e1fff2e7d2da', part: "next", type: "button", class: "bs-datepicker__nav-button", "aria-label": this.nextLabel, onClick: () => this.moveView(1) }, index.h("svg", { key: '47f183221234d91d736f45207e84b14ee57b469f', viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true" }, index.h("path", { key: 'bd4abceed66ef781fab224646d371b648d3c0d1d', d: "M9 18L15 12L9 6", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })))), index.h("div", { key: 'e669ad28eb8461dcf5a24191dca379ab3cbc0111', part: "grid", class: "bs-datepicker__grid", role: "grid", "aria-label": this.titleText() }, index.h("div", { key: '440719175dd4f4a745b9de22126029633bfe91a3', class: "bs-datepicker__row", role: "row" }, weekdays.map(w => (index.h("div", { part: "weekday", class: "bs-datepicker__weekday", role: "columnheader" }, w)))), Array.from({ length: 6 }, (_, r) => {
|
|
314
|
+
const row = days.slice(r * 7, r * 7 + 7);
|
|
315
|
+
return (index.h("div", { class: "bs-datepicker__row", role: "row" }, row.map((d, c) => {
|
|
316
|
+
const iso = toIso(d);
|
|
317
|
+
const outside = d.getMonth() !== this.viewDate.getMonth();
|
|
318
|
+
const isStart = iso === selectedStart;
|
|
319
|
+
const isEnd = !!selectedEnd && iso === selectedEnd;
|
|
320
|
+
const selected = isStart || isEnd;
|
|
321
|
+
const inRange = isInRange(iso);
|
|
322
|
+
// Figma: the band covers only the days between the two ends, rounded where a run
|
|
323
|
+
// starts/ends (also at a week boundary), with the end days sitting outside it.
|
|
324
|
+
const classes = {
|
|
325
|
+
'bs-datepicker__cell': true,
|
|
326
|
+
'bs-datepicker__cell--in-range': inRange,
|
|
327
|
+
'bs-datepicker__cell--band-start': inRange && !(c > 0 && isInRange(toIso(row[c - 1]))),
|
|
328
|
+
'bs-datepicker__cell--band-end': inRange && !(c < 6 && isInRange(toIso(row[c + 1]))),
|
|
329
|
+
};
|
|
330
|
+
const parts = ['day', selected && 'selected', inRange && 'in-range', outside && 'outside', iso === todayIso && 'today']
|
|
331
|
+
.filter(Boolean)
|
|
332
|
+
.join(' ');
|
|
333
|
+
return (index.h("div", { class: classes, role: "gridcell", "aria-selected": selected || inRange ? 'true' : 'false' }, index.h("button", { part: parts, type: "button", class: {
|
|
334
|
+
'bs-datepicker__day': true,
|
|
335
|
+
'bs-datepicker__day--selected': selected,
|
|
336
|
+
'bs-datepicker__day--in-range': inRange,
|
|
337
|
+
'bs-datepicker__day--outside': outside,
|
|
338
|
+
'bs-datepicker__day--today': iso === todayIso,
|
|
339
|
+
}, "data-date": iso, tabindex: iso === tabbable ? 0 : -1, disabled: this.isDisabled(d), "aria-current": iso === todayIso ? 'date' : undefined, "aria-label": new Intl.DateTimeFormat(this.fmt, { weekday: 'long', day: '2-digit', month: 'long', year: 'numeric' }).format(d), onClick: () => this.selectDay(d), onKeyDown: ev => this.onKeyDown(ev, d), onMouseEnter: () => {
|
|
340
|
+
if (this.range && this.start && !this.end)
|
|
341
|
+
this.hoverIso = iso;
|
|
342
|
+
} }, String(d.getDate()).padStart(2, '0'))));
|
|
343
|
+
})));
|
|
344
|
+
}))));
|
|
345
|
+
}
|
|
346
|
+
/** The day that should be reachable with Tab when nothing in view has been focused yet: the
|
|
347
|
+
* selection if it's in the displayed month, else today if it is, else the 1st. */
|
|
348
|
+
defaultTabbable(days) {
|
|
349
|
+
const inView = (iso) => days.some(d => toIso(d) === iso && d.getMonth() === this.viewDate.getMonth());
|
|
350
|
+
const selected = this.range ? this.start : this.value;
|
|
351
|
+
if (selected && inView(selected))
|
|
352
|
+
return selected;
|
|
353
|
+
const today = toIso(new Date());
|
|
354
|
+
if (inView(today))
|
|
355
|
+
return today;
|
|
356
|
+
return toIso(this.viewDate);
|
|
357
|
+
}
|
|
358
|
+
static get formAssociated() { return true; }
|
|
359
|
+
static get watchers() { return {
|
|
360
|
+
"value": [{
|
|
361
|
+
"onSelectionChange": 0
|
|
362
|
+
}, {
|
|
363
|
+
"onSelectionJump": 0
|
|
364
|
+
}],
|
|
365
|
+
"start": [{
|
|
366
|
+
"onSelectionChange": 0
|
|
367
|
+
}, {
|
|
368
|
+
"onSelectionJump": 0
|
|
369
|
+
}],
|
|
370
|
+
"end": [{
|
|
371
|
+
"onSelectionChange": 0
|
|
372
|
+
}],
|
|
373
|
+
"range": [{
|
|
374
|
+
"onSelectionChange": 0
|
|
375
|
+
}],
|
|
376
|
+
"name": [{
|
|
377
|
+
"onSelectionChange": 0
|
|
378
|
+
}]
|
|
379
|
+
}; }
|
|
380
|
+
};
|
|
381
|
+
// --- date helpers (local time; `YYYY-MM-DD` strings) ---------------------------------------
|
|
382
|
+
function pad(n) {
|
|
383
|
+
return String(n).padStart(2, '0');
|
|
384
|
+
}
|
|
385
|
+
function toIso(d) {
|
|
386
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
387
|
+
}
|
|
388
|
+
function parseIso(s) {
|
|
389
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec((s ?? '').trim());
|
|
390
|
+
if (!m)
|
|
391
|
+
return undefined;
|
|
392
|
+
const d = new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3]));
|
|
393
|
+
// Reject overflow such as 2026-02-31, which `Date` silently rolls into March.
|
|
394
|
+
return toIso(d) === `${m[1]}-${m[2]}-${m[3]}` ? d : undefined;
|
|
395
|
+
}
|
|
396
|
+
function firstOfMonth(d) {
|
|
397
|
+
return new Date(d.getFullYear(), d.getMonth(), 1);
|
|
398
|
+
}
|
|
399
|
+
function addDays(d, n) {
|
|
400
|
+
return new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);
|
|
401
|
+
}
|
|
402
|
+
function addMonths(d, n) {
|
|
403
|
+
// Clamp so Jan 31 + 1 month is Feb 28, not Mar 3.
|
|
404
|
+
const target = new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
405
|
+
const lastDay = new Date(target.getFullYear(), target.getMonth() + 1, 0).getDate();
|
|
406
|
+
return new Date(target.getFullYear(), target.getMonth(), Math.min(d.getDate(), lastDay));
|
|
407
|
+
}
|
|
408
|
+
BsDatepicker.style = bsDatepickerCss();
|
|
409
|
+
|
|
410
|
+
exports.bs_datepicker = BsDatepicker;
|
|
@@ -71,7 +71,7 @@ const BsFileUploadItem = class {
|
|
|
71
71
|
}
|
|
72
72
|
render() {
|
|
73
73
|
const removing = this.state === 'success';
|
|
74
|
-
return (index.h("div", { key: '
|
|
74
|
+
return (index.h("div", { key: '6b7fc89949cfa70838cc60d94ccb91afe09f75cd', part: "item", class: `bs-file-upload-item bs-file-upload-item--${this.state}` }, index.h("div", { key: '55923d2fc56d8b1794a3a0d835440cd428e1e168', part: "thumbnail", class: "bs-file-upload-item__thumbnail" }, index.h("slot", { key: '25f93a00ba465db98c73f1bf38abc46110ae5c82', name: "thumbnail" }, this.thumbnailSrc ? (index.h("img", { class: "bs-file-upload-item__image", src: this.thumbnailSrc, alt: this.thumbnailAlt })) : (index.h(ImageIcon, null)))), index.h("div", { key: 'ab975fe4e7e888755f9ceae00b6633f86b856c47', class: "bs-file-upload-item__content" }, index.h("div", { key: '6b1c9161edd76c799f0c545e2f939907bbb1dcee', class: "bs-file-upload-item__meta" }, index.h("span", { key: '3b7ca85e645d19b1ef1affff55a8e2a2284aff72', part: "name", class: "bs-file-upload-item__name" }, this.fileName), this.fileSize && (index.h("span", { key: '70dd2e29628bd536dac520ffe653bc7651f41c33', part: "size", class: "bs-file-upload-item__size" }, this.fileSize))), this.renderStatus()), index.h("bs-icon-button", { key: '5ac7e596601ebdb35add9e278f17f67db4758e48', part: "action", variant: "subtle", size: "lg", ariaLabel: removing ? this.removeLabel : this.cancelLabel, onClick: this.onAction }, removing ? index.h(TrashIcon, null) : index.h(CloseIcon, null))));
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
// Figma exports, recolored via currentColor so the CSS tokens drive the color.
|
|
@@ -100,7 +100,7 @@ const BsFileUpload = class {
|
|
|
100
100
|
this.handleFiles(files);
|
|
101
101
|
};
|
|
102
102
|
render() {
|
|
103
|
-
return (index.h("div", { key: '
|
|
103
|
+
return (index.h("div", { key: 'b33535fd240d2d406118fd64fd9c227dea7ecd6e', part: "dropzone", class: `bs-file-upload bs-file-upload--${this.direction} ${this.dragging ? 'bs-file-upload--dragging' : ''} ${this.disabled ? 'bs-file-upload--disabled' : ''}`, onDragEnter: this.onDragOver, onDragOver: this.onDragOver, onDragLeave: this.onDragLeave, onDrop: this.onDrop }, index.h("div", { key: '38cc0d7e10cbdfd9daef5749c2b50ec7c9123f71', part: "icon", class: "bs-file-upload__icon" }, index.h("slot", { key: '0e9cadb8101a73f55410eb30b2ddbf9c5e2cd0ed', name: "icon" }, index.h(UploadIcon, { key: '3f745666d0967ab5de4a6824a0fc8b3e0f7f900b' }))), index.h("div", { key: '7e347497915149907ade2e90aa19bd339b013be9', class: "bs-file-upload__content" }, index.h("div", { key: 'ea3a760d44b38cd5397d5952dbee998ddb2bea1b', class: "bs-file-upload__text" }, this.heading && (index.h("span", { key: '9e00cc05d2b479964502243e1dda32eb7fa81e42', part: "heading", class: "bs-file-upload__heading" }, this.heading)), this.description && (index.h("span", { key: 'abb9857cdd2c85a7730101d05a5704d947c669bd', part: "description", id: "description", class: "bs-file-upload__description" }, this.description))), index.h("bs-button", { key: '98dea0715d7c0c641c552025403febd13fe4c32f', part: "browse", variant: "neutral", size: "sm", disabled: this.disabled, onClick: this.onBrowse }, this.buttonLabel)), index.h("input", { key: '0c83fdaba93b46128e4990f9d15a746fd95479f5', ref: el => (this.inputEl = el), class: "bs-file-upload__input", type: "file", hidden: true, tabindex: -1, accept: this.accept, multiple: this.multiple, disabled: this.disabled, "aria-describedby": this.description ? 'description' : undefined, onChange: this.onInputChange })));
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
// Figma's "UploadSimple" icon (3272:50330), exported SVG, recolored via currentColor.
|
|
@@ -49,7 +49,7 @@ const BsIconButton = class {
|
|
|
49
49
|
form.reset();
|
|
50
50
|
};
|
|
51
51
|
render() {
|
|
52
|
-
return (index.h("button", { key: '
|
|
52
|
+
return (index.h("button", { key: '433827a167fc7ce5183358c3e8469d68dd67788a', class: `bs-icon-button bs-icon-button--${this.variant} bs-icon-button--${this.size}`, type: this.type, disabled: this.disabled, "aria-label": this.ariaLabel, onClick: this.onClick }, index.h("span", { key: 'e7d50a6755e7e4de39db799abef38c118d888b98', part: "icon", class: "bs-icon-button__icon" }, index.h("slot", { key: 'a737620ca5d0baf69abc1964a160492c32359d09' }))));
|
|
53
53
|
}
|
|
54
54
|
static get delegatesFocus() { return true; }
|
|
55
55
|
static get formAssociated() { return true; }
|
|
@@ -69,7 +69,7 @@ const BsInlineTab = class {
|
|
|
69
69
|
};
|
|
70
70
|
render() {
|
|
71
71
|
const iconOnly = this.hasIcon && !this.hasLabel;
|
|
72
|
-
return (index.h("button", { key: '
|
|
72
|
+
return (index.h("button", { key: '2b53f8013cdcd94dd7297ece3cff679d158a86a8', type: "button", part: "tab", role: "tab", class: `bs-inline-tab ${this.selected ? 'bs-inline-tab--selected' : ''} ${this.disabled ? 'bs-inline-tab--disabled' : ''} ${iconOnly ? 'bs-inline-tab--icon-only' : ''} ${this.hasIcon ? 'bs-inline-tab--has-icon' : ''}`, disabled: this.disabled, "aria-selected": String(this.selected), "aria-disabled": this.disabled ? 'true' : undefined, "aria-label": this.ariaLabel, tabIndex: this.tabbable === undefined ? undefined : this.tabbable ? 0 : -1, onClick: this.onClick }, index.h("span", { key: '4e4832cffe54b28cdd68f7c35c9741dfe001b4d5', part: "icon", class: `bs-inline-tab__icon ${this.hasIcon ? 'bs-inline-tab__icon--has-content' : ''}` }, index.h("slot", { key: 'ccc3225b1a9047a0a346b8fb8bf6f02a63ecc988', name: "icon", onSlotchange: this.onIconSlotchange })), index.h("span", { key: '95c8ac8ba725cf9ed20887dfee0c88d0dd0ce180', part: "label", class: `bs-inline-tab__label ${this.hasLabel ? 'bs-inline-tab__label--has-content' : ''}` }, index.h("slot", { key: 'f9551ac1fe994a7e66fe48d23b39f2936c6b5a37', onSlotchange: this.onLabelSlotchange }))));
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
BsInlineTab.style = bsInlineTabCss();
|
|
@@ -288,7 +288,10 @@ const BsInput = class {
|
|
|
288
288
|
}
|
|
289
289
|
renderStandardControl() {
|
|
290
290
|
const nativeType = this.type === 'password' ? (this.passwordVisible ? 'text' : 'password') : this.type === 'dropdown' ? 'text' : this.type;
|
|
291
|
-
return (index.h("input", { id: "control", part: "control", class: "bs-input__control", type: nativeType, value: this.value, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.type === 'dropdown',
|
|
291
|
+
return (index.h("input", { id: "control", part: "control", class: "bs-input__control", type: nativeType, value: this.value, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.type === 'dropdown',
|
|
292
|
+
// The popup state belongs on the focusable control (a roleless wrapper div can't carry
|
|
293
|
+
// aria-haspopup/aria-expanded -- axe's aria-allowed-attr flags it).
|
|
294
|
+
role: this.type === 'dropdown' ? 'combobox' : undefined, "aria-haspopup": this.type === 'dropdown' ? 'listbox' : undefined, "aria-expanded": this.type === 'dropdown' ? String(this.open) : undefined, min: this.type === 'number' ? this.min : undefined, max: this.type === 'number' ? this.max : undefined, step: this.type === 'number' ? this.step : undefined, "aria-describedby": this.error || this.description ? 'description-or-error' : undefined, "aria-invalid": this.error ? 'true' : undefined, "aria-required": this.required ? 'true' : undefined, onInput: this.onInput, onChange: this.onChange }));
|
|
292
295
|
}
|
|
293
296
|
renderSelectControl() {
|
|
294
297
|
return (index.h("select", { id: "control", part: "control", class: "bs-input__control", disabled: this.disabled, "aria-describedby": this.error || this.description ? 'description-or-error' : undefined, "aria-invalid": this.error ? 'true' : undefined, "aria-required": this.required ? 'true' : undefined, onInput: this.onInput, onChange: this.onChange }, this.options.map(opt => (index.h("option", { value: opt.value, selected: opt.value === this.value }, opt.label)))));
|
|
@@ -348,7 +351,7 @@ const BsInput = class {
|
|
|
348
351
|
.filter(Boolean)
|
|
349
352
|
.join(' ');
|
|
350
353
|
const isDropdown = this.type === 'dropdown';
|
|
351
|
-
return (index.h("div", { class: "bs-input__field-wrapper" }, index.h("div", { part: "field", class: fieldClasses, onClick: isDropdown ? this.onDropdownToggle : undefined, onKeyDown: isDropdown ? this.onDropdownKeydown : undefined
|
|
354
|
+
return (index.h("div", { class: "bs-input__field-wrapper" }, index.h("div", { part: "field", class: fieldClasses, onClick: isDropdown ? this.onDropdownToggle : undefined, onKeyDown: isDropdown ? this.onDropdownKeydown : undefined }, index.h("span", { part: "icon", class: `bs-input__icon ${this.showsIconArea ? 'bs-input__icon--visible' : ''}` }, this.renderIconContent()), this.renderControl(), index.h("span", { part: "end-icon", class: `bs-input__end-icon ${this.showsEndIconArea ? 'bs-input__end-icon--visible' : ''}` }, this.renderEndIconContent())), isDropdown && this.open && this.options.length > 0 && (index.h("bs-menu", { part: "menu", class: "bs-input__dropdown-menu", role: "listbox" }, this.options.map(option => (index.h("bs-menu-item", { key: option.value, onBsSelect: this.onDropdownOptionSelect(option) }, option.label)))))));
|
|
352
355
|
}
|
|
353
356
|
renderPinField() {
|
|
354
357
|
this.pinInputs = [];
|
|
@@ -357,10 +360,10 @@ const BsInput = class {
|
|
|
357
360
|
return (index.h("div", { part: "field", class: `bs-input__field bs-input__field--pin ${errorClass} ${disabledClass}` }, Array.from({ length: this.length }).map((_, i) => (index.h("input", { id: i === 0 ? 'control' : undefined, ref: el => (this.pinInputs[i] = el), part: "control", class: "bs-input__pin-cell", type: "text", inputMode: "numeric", maxLength: 1, value: this.value[i] ?? '', disabled: this.disabled, "aria-required": this.required ? 'true' : undefined, onInput: this.onPinInput(i), onKeyDown: this.onPinKeydown(i) })))));
|
|
358
361
|
}
|
|
359
362
|
render() {
|
|
360
|
-
return (index.h("div", { key: '
|
|
363
|
+
return (index.h("div", { key: '70497bf30b0a244e1df36075d0db77cec5345d6c', class: `bs-input ${this.error ? 'bs-input--error' : ''}` }, this.label && (
|
|
361
364
|
// "control" is a fixed id, not a generated one -- safe because Shadow DOM scopes ids
|
|
362
365
|
// to this instance's own shadow root, so it can never collide with another bs-input.
|
|
363
|
-
index.h("label", { key: '
|
|
366
|
+
index.h("label", { key: '527e0d146170d9d11a004d452fa2cb363c5cc7d2', part: "label", class: "bs-input__label", htmlFor: "control" }, this.label, this.required && (index.h("span", { key: '9dd54a626ec80c774d6deacc3c9dcf02d1fef8a9', part: "required", class: "bs-input__required", "aria-hidden": "true" }, "*")))), this.type === 'pin' ? this.renderPinField() : this.type === 'initials' ? this.renderInitialsField() : this.renderField(), this.error ? (index.h("span", { id: "description-or-error", part: "error", class: "bs-input__error" }, index.h("svg", { part: "error-icon", class: "bs-input__error-icon", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, index.h("circle", { cx: "8", cy: "8", r: "6.5", stroke: "currentColor", "stroke-width": "1.2" }), index.h("path", { d: "M8 5V8.5", stroke: "currentColor", "stroke-width": "1.2", "stroke-linecap": "round" }), index.h("circle", { cx: "8", cy: "11", r: "0.75", fill: "currentColor" })), this.error)) : this.description ? (index.h("span", { id: "description-or-error", part: "description", class: "bs-input__description" }, this.description)) : null));
|
|
364
367
|
}
|
|
365
368
|
static get delegatesFocus() { return true; }
|
|
366
369
|
static get formAssociated() { return true; }
|
|
@@ -381,4 +384,34 @@ const BsInput = class {
|
|
|
381
384
|
};
|
|
382
385
|
BsInput.style = bsInputCss();
|
|
383
386
|
|
|
387
|
+
const bsMenuItemCss = () => `:host{display:block;--bs-menu-item-radius:var(--bs-border-radius-100);--bs-menu-item-padding-y:var(--bs-spacing-100);--bs-menu-item-padding-x:var(--bs-spacing-150);--bs-menu-item-gap:var(--bs-spacing-100);--bs-menu-item-hover:var(--bs-color-neutral-container-hover);--bs-menu-item-pressed:var(--bs-color-neutral-container-pressed);--bs-menu-item-disabled-bg:var(--bs-surface-action-disabled);--bs-menu-item-icon-color:var(--bs-icon-default);--bs-menu-item-icon-color-disabled:var(--bs-icon-disabled);--bs-menu-item-color:var(--bs-text-muted);--bs-menu-item-color-disabled:var(--bs-text-on-disabled);--bs-menu-item-font-size:var(--bs-font-size-md);--bs-menu-item-line-height:var(--bs-line-height-body-md)}.bs-menu-item{box-sizing:border-box;display:flex;align-items:center;width:100%;height:48px;border:none;cursor:pointer;background:transparent;color:var(--bs-menu-item-color);font-family:inherit;border-radius:var(--bs-menu-item-radius);padding:var(--bs-menu-item-padding-y) var(--bs-menu-item-padding-x);gap:var(--bs-menu-item-gap);transition:background-color var(--bs-duration-fast) var(--bs-easing-standard)}.bs-menu-item:focus-visible{outline:2px solid var(--bs-border-neutral-focus);outline-offset:2px}.bs-menu-item:hover{background:var(--bs-menu-item-hover)}.bs-menu-item:active{background:var(--bs-menu-item-pressed)}.bs-menu-item--disabled{background:var(--bs-menu-item-disabled-bg);color:var(--bs-menu-item-color-disabled);cursor:not-allowed}.bs-menu-item--disabled:hover,.bs-menu-item--disabled:active{background:var(--bs-menu-item-disabled-bg)}.bs-menu-item--disabled .bs-menu-item__icon{color:var(--bs-menu-item-icon-color-disabled)}.bs-menu-item__icon{display:none;width:24px;height:24px;flex-shrink:0;color:var(--bs-menu-item-icon-color)}.bs-menu-item__icon--has-content{display:inline-flex;align-items:center;justify-content:center}.bs-menu-item__icon ::slotted(svg){width:24px;height:24px}.bs-menu-item__label{font-size:var(--bs-menu-item-font-size);line-height:calc(var(--bs-menu-item-line-height) * 1px);white-space:nowrap}`;
|
|
388
|
+
|
|
389
|
+
const BsMenuItem = class {
|
|
390
|
+
constructor(hostRef) {
|
|
391
|
+
index.registerInstance(this, hostRef);
|
|
392
|
+
this.bsSelect = index.createEvent(this, "bsSelect");
|
|
393
|
+
}
|
|
394
|
+
/** Disables the item: no hover/pressed/focus styling, no pointer cursor, not reachable by
|
|
395
|
+
* keyboard tabbing, and clicking it does not emit `bsSelect`. */
|
|
396
|
+
disabled = false;
|
|
397
|
+
/** Tracks whether the `icon` slot has assigned content, so the icon wrapper (and its gap) only
|
|
398
|
+
* renders when there's actually an icon to show. */
|
|
399
|
+
hasIcon = false;
|
|
400
|
+
/** Fires when the item is clicked. */
|
|
401
|
+
bsSelect;
|
|
402
|
+
onIconSlotchange = (ev) => {
|
|
403
|
+
this.hasIcon = ev.target.assignedNodes().length > 0;
|
|
404
|
+
};
|
|
405
|
+
onClick = () => {
|
|
406
|
+
if (this.disabled)
|
|
407
|
+
return;
|
|
408
|
+
this.bsSelect.emit();
|
|
409
|
+
};
|
|
410
|
+
render() {
|
|
411
|
+
return (index.h("button", { key: '5aabea2ec3ad0181e3ff53b3f22873563da69ccd', type: "button", part: "item", role: "menuitem", class: `bs-menu-item ${this.disabled ? 'bs-menu-item--disabled' : ''}`, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : undefined, onClick: this.onClick }, index.h("span", { key: '7e180921d99d4f430d72d8dbfeda0ca00881b74a', part: "icon", class: `bs-menu-item__icon ${this.hasIcon ? 'bs-menu-item__icon--has-content' : ''}` }, index.h("slot", { key: '9d6d15f2d51c271de699b0101f781d8c0f3ab7e9', name: "icon", onSlotchange: this.onIconSlotchange })), index.h("span", { key: '88645fe2991eb91a145e33a4f5e5e59a9ade3248', part: "label", class: "bs-menu-item__label" }, index.h("slot", { key: 'd3cc0ffcf0f354ffa9c48cbc88a99ec99d4f2db4' }))));
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
BsMenuItem.style = bsMenuItemCss();
|
|
415
|
+
|
|
384
416
|
exports.bs_input = BsInput;
|
|
417
|
+
exports.bs_menu_item = BsMenuItem;
|
|
@@ -31,7 +31,7 @@ const BsMenu = class {
|
|
|
31
31
|
items[next].shadowRoot?.querySelector('button')?.focus();
|
|
32
32
|
}
|
|
33
33
|
render() {
|
|
34
|
-
return (index.h("div", { key: '
|
|
34
|
+
return (index.h("div", { key: '24e54ac14b17bc1e45bcd5d7d0fda3250350672a', part: "list", class: "bs-menu", role: "menu" }, index.h("slot", { key: '57e28eafbb83da6bb14dfe588793edd33b2b5316' })));
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
BsMenu.style = bsMenuCss();
|
|
@@ -93,7 +93,7 @@ const BsNavigationDrawerItem = class {
|
|
|
93
93
|
// incorrectly also toggle this parent row on every child click. Both are wrapped in a
|
|
94
94
|
// `display: contents` container so render() still returns a single root node (this codebase's
|
|
95
95
|
// convention, e.g. bs-input.tsx) without that wrapper affecting layout at all.
|
|
96
|
-
return (index.h("div", { key: '
|
|
96
|
+
return (index.h("div", { key: 'a62142391a3302dd6379135af11aa3215786df60', class: "bs-navigation-drawer-item__root" }, index.h("button", { key: '859f32bb1588ec661fea55d405a60a20e803b969', type: "button", part: "item", class: rowClasses, "aria-expanded": this.expandable ? String(this.expanded) : undefined, "aria-label": this.ariaLabel ?? undefined, onClick: this.onClick }, !this.nested && (index.h("span", { key: '0191eb506a8fa145732fb250d52d1ad650ea9a0f', part: "icon", class: `bs-navigation-drawer-item__icon ${this.hasIcon ? 'bs-navigation-drawer-item__icon--has-content' : ''}` }, index.h("slot", { key: '29bfc6b85d32172ac4f92ca482ffcbf71ed2158c', name: "icon", onSlotchange: this.onIconSlotchange }))), index.h("span", { key: 'd5e681c8dfc6b8517a01caea2daa49089ef73994', part: "label", class: "bs-navigation-drawer-item__label" }, index.h("slot", { key: '6f60e5831a064caae85747d6c6b735912abc9a3c' })), this.expandable && (index.h("span", { key: '37eebaa53518961ac10e37abe8a6f68e1066b173', part: "chevron", class: `bs-navigation-drawer-item__chevron ${this.expanded ? 'bs-navigation-drawer-item__chevron--expanded' : ''}` }, index.h(ChevronDownIcon, { key: '5c212defdf0226202d710f799dbf380aca087ff6' })))), this.expandable && (index.h("span", { key: 'abc9eb5ca2161706511b3691c71d5fedd33ee74f', part: "children", class: "bs-navigation-drawer-item__children" }, index.h("slot", { key: '9b501d624d2bd055e4a71848d08dfb7198e17ece', name: "children" })))));
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
// 16x16 native viewBox (not a 24x24 icon scaled down) -- authored directly at display size, per
|
|
@@ -174,11 +174,11 @@ const BsNavigationDrawer = class {
|
|
|
174
174
|
};
|
|
175
175
|
render() {
|
|
176
176
|
const classes = ['bs-navigation-drawer', this.mobile ? 'bs-navigation-drawer--overlay' : '', this.overlayOpen ? 'bs-navigation-drawer--open' : ''].filter(Boolean).join(' ');
|
|
177
|
-
return (index.h(index.Host, { key: '
|
|
177
|
+
return (index.h(index.Host, { key: 'c1e563e7b2a9474286671a3f6e1f2d3aed312620', "data-overlay": this.mobile ? '' : undefined }, this.mobile && index.h("div", { key: 'f6885e88df1607bb9e85a27c4e1cb616ce6b6c0d', part: "backdrop", class: "bs-navigation-drawer__backdrop", onClick: this.requestClose }), index.h("nav", { key: 'a3086b5203fd3724fce5fe82be394a77a6d9a1e1', ref: el => (this.navRef = el), class: classes, "aria-label": this.heading,
|
|
178
178
|
// Stays a plain <nav> landmark in every state: ARIA does not allow role="dialog" on <nav>
|
|
179
179
|
// (axe: aria-allowed-role). Modality is behavioral -- focus is held inside, the page behind is
|
|
180
180
|
// scrimmed, Escape closes -- rather than announced through aria-modal.
|
|
181
|
-
tabIndex: this.mobile ? -1 : undefined }, this.showLogo && (index.h("div", { key: '
|
|
181
|
+
tabIndex: this.mobile ? -1 : undefined }, this.showLogo && (index.h("div", { key: 'c1b8700d6936ae14acf900d3cc83c6a8a7d79a20', part: "logo", class: "bs-navigation-drawer__logo bs-navigation-drawer__logo--full" }, index.h("bs-logo", { key: '27f4205dcdd609c4709a09dbeb7d4d59a41340db', variant: "full", background: this.logoBackground }))), this.showLogo && (index.h("div", { key: 'b8474734a50dbd690a9a8d8febd6cda084498d02', part: "logo", class: "bs-navigation-drawer__logo bs-navigation-drawer__logo--mark" }, index.h("bs-logo", { key: 'c89909a16f7255d24ddaae54ddd2c6cfca361572', variant: "mark", background: this.logoBackground }))), index.h("div", { key: '83b7641c3c1f8b8307bf8006bbef147ccfdc917c', class: "bs-navigation-drawer__title-row" }, index.h("span", { key: '97075d0df805b02f3f520c42ef4eceaa377e7064', part: "title", class: "bs-navigation-drawer__title" }, this.heading), this.collapsible && (index.h("button", { key: '184f4f2f35f74f145621d2854a6a50e52006ebd1', type: "button", part: "collapse", class: "bs-navigation-drawer__collapse", "aria-label": this.collapsed ? 'Expand' : 'Collapse', "aria-pressed": this.collapsed ? 'true' : 'false', onClick: this.onCollapseClick }, index.h(CaretLeftIcon, { key: '168c4a4f30f9cf92afd5cffc63e989e0a3d4e45a' })))), index.h("div", { key: 'd93ec72e4f6ba6f01d4fdc8fc3d9e0c9f0649242', part: "search", class: "bs-navigation-drawer__search" }, index.h("slot", { key: '3441fb753d206b84e68bb777e60ec849185882b9', name: "search" })), index.h("button", { key: '98b3bf5e4807afb1ba5a91e2b5238d917f584ab8', type: "button", part: "search-trigger", class: "bs-navigation-drawer__search-trigger", "aria-label": "Search", onClick: this.onSearchTriggerClick }, index.h(SearchIcon, { key: 'c61c32465503084caab0b3741bc95e3f0f274214' })), index.h("div", { key: 'f75111a609795d6ed83e3e843a433440a932b730', part: "items", class: "bs-navigation-drawer__items" }, index.h("slot", { key: '50f7cee1ae4e352b56561740bfc6ff035d521354' })))));
|
|
182
182
|
}
|
|
183
183
|
static get watchers() { return {
|
|
184
184
|
"collapsed": [{
|