bitboss-ui 3.0.0-beta.69 → 3.0.0-beta.71
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/README.md +20 -11
- package/bin/bitboss-ui-mcp.mjs +7 -4
- package/bin/bitboss-ui.mjs +0 -0
- package/bin/cli.mjs +47 -28
- package/dist/ai/BbBaseButton.md +4 -4
- package/dist/ai/BbBreadcrumbs.md +3 -0
- package/dist/ai/BbCarousel.md +32 -29
- package/dist/ai/BbCheckbox.md +5 -6
- package/dist/ai/BbCheckboxGroup.md +28 -26
- package/dist/ai/BbColorInput.md +9 -14
- package/dist/ai/BbDatePickerInput.md +3 -4
- package/dist/ai/BbDropdown.md +35 -1
- package/dist/ai/BbDropdownButton.md +4 -3
- package/dist/ai/BbDropzone.md +3 -3
- package/dist/ai/BbGallery.md +2034 -0
- package/dist/ai/BbNumberInput.md +3 -4
- package/dist/ai/BbPopover.md +12 -6
- package/dist/ai/BbRadio.md +5 -6
- package/dist/ai/BbRadioGroup.md +28 -31
- package/dist/ai/BbRating.md +6 -16
- package/dist/ai/BbSelect.md +10 -11
- package/dist/ai/BbSlider.md +3 -9
- package/dist/ai/BbSwitch.md +6 -6
- package/dist/ai/BbSwitchGroup.md +4 -7
- package/dist/ai/BbTag.md +3 -4
- package/dist/ai/BbTextInput.md +19 -19
- package/dist/ai/BbTextarea.md +8 -8
- package/dist/ai/BbTimePickerInput.md +3 -4
- package/dist/ai/BbTooltip.md +17 -13
- package/dist/ai/CommonField.md +2 -10
- package/dist/ai/OptionsContainer.md +7 -12
- package/dist/ai/changelog.json +119 -4
- package/dist/ai/components.json +37 -32
- package/dist/ai/guides/ai-router.md +3 -2
- package/dist/ai/guides/component-picker.md +1 -0
- package/dist/ai/guides/eslint-rules.md +3 -3
- package/dist/ai/guides/installation-and-plugin-setup.md +5 -5
- package/dist/ai/guides/migration/v2-to-v3.md +53 -1
- package/dist/ai/guides/migration/v3-beta-tooling.md +25 -15
- package/dist/ai/guides/passthrough.md +2 -1
- package/dist/ai/guides/preset-components.md +53 -19
- package/dist/ai/helpers/definePreset.json +8 -1
- package/dist/ai/helpers/definePreset.ts +42 -13
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/index.md +2 -1
- package/dist/ai/manifest/common.json +2 -2
- package/dist/ai/manifest/components/BbBreadcrumbs.json +1 -1
- package/dist/ai/manifest/components/BbCarousel.json +3 -2
- package/dist/ai/manifest/components/BbCarousel.tree.json +7 -0
- package/dist/ai/manifest/components/BbCheckbox.json +2 -2
- package/dist/ai/manifest/components/BbCheckbox.tree.json +1 -1
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +10 -18
- package/dist/ai/manifest/components/BbColorInput.json +2 -2
- package/dist/ai/manifest/components/BbColorInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbConfigScope.json +1 -1
- package/dist/ai/manifest/components/BbDatePickerInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbDropdown.json +2 -2
- package/dist/ai/manifest/components/BbDropdownButton.json +2 -2
- package/dist/ai/manifest/components/BbGallery.json +54 -0
- package/dist/ai/manifest/components/BbGallery.tree.json +139 -0
- package/dist/ai/manifest/components/BbNumberInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbRadio.tree.json +1 -1
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +9 -17
- package/dist/ai/manifest/components/BbRating.removed.json +1 -1
- package/dist/ai/manifest/components/BbRating.tree.json +1 -1
- package/dist/ai/manifest/components/BbSelect.json +15 -15
- package/dist/ai/manifest/components/BbSelect.tree.json +1 -1
- package/dist/ai/manifest/components/BbSlider.json +1 -1
- package/dist/ai/manifest/components/BbSlider.tree.json +1 -1
- package/dist/ai/manifest/components/BbSwitch.tree.json +1 -1
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -2
- package/dist/ai/manifest/components/BbTabs.removed.json +4 -4
- package/dist/ai/manifest/components/BbTabsList.removed.json +4 -4
- package/dist/ai/manifest/components/BbTag.tree.json +1 -1
- package/dist/ai/manifest/components/BbTextInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbTextarea.tree.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbTooltip.json +1 -1
- package/dist/ai/manifest/components/BbTooltip.tree.json +2 -2
- package/dist/ai/manifest/components/CommonField.tree.json +5 -10
- package/dist/ai/manifest/components/OptionsContainer.tree.json +7 -12
- package/dist/ai/manifest/index.json +4 -3
- package/dist/ai/manifest/meta.json +5 -1
- package/dist/ai/manifest/types.advanced.json +4 -2
- package/dist/ai/manifest/types.api.json +3 -3
- package/dist/ai/manifest/types.wrapper.json +1 -0
- package/dist/ai/recipes/inertia/onboarding.md +5 -8
- package/dist/ai/recipes/inertia/record-form.md +33 -12
- package/dist/ai/recipes/nuxt/onboarding.md +5 -8
- package/dist/ai/recipes/nuxt/record-form.md +27 -11
- package/dist/ai/recipes/vue/onboarding.md +5 -8
- package/dist/ai/recipes/vue/record-form.md +25 -11
- package/dist/ai/source/BbBreadcrumbs.md +31 -12
- package/dist/ai/source/BbCalendar.md +2 -0
- package/dist/ai/source/BbCarousel.md +135 -32
- package/dist/ai/source/BbCheckbox.md +36 -42
- package/dist/ai/source/BbCheckboxGroup.md +2 -4
- package/dist/ai/source/BbColorInput.md +2 -4
- package/dist/ai/source/BbDatePickerInput.md +2 -4
- package/dist/ai/source/BbDropdown.md +13 -2
- package/dist/ai/source/BbDropdownButton.md +4 -1
- package/dist/ai/source/BbDropdownGroup.md +11 -2
- package/dist/ai/source/BbGallery.md +2027 -0
- package/dist/ai/source/BbNumberInput.md +2 -4
- package/dist/ai/source/BbRadio.md +36 -42
- package/dist/ai/source/BbRadioGroup.md +4 -6
- package/dist/ai/source/BbRating.md +2 -14
- package/dist/ai/source/BbSelect.md +30 -13
- package/dist/ai/source/BbSelectPopover.md +1 -0
- package/dist/ai/source/BbSlider.md +2 -4
- package/dist/ai/source/BbSwitch.md +34 -38
- package/dist/ai/source/BbSwitchGroup.md +1 -0
- package/dist/ai/source/BbTable.md +15 -8
- package/dist/ai/source/BbTag.md +2 -4
- package/dist/ai/source/BbTextInput.md +2 -4
- package/dist/ai/source/BbTextarea.md +2 -4
- package/dist/ai/source/BbTimePickerInput.md +2 -4
- package/dist/ai/source/BbTooltip.md +9 -3
- package/dist/ai/source/BbTree.md +7 -3
- package/dist/ai/source/CommonField.md +17 -106
- package/dist/ai/source/CommonPopover.md +13 -3
- package/dist/ai/source/FlatListBox.md +3 -3
- package/dist/ai/source/GroupedListBox.md +3 -3
- package/dist/ai/source/GuidesComponent.md +3 -0
- package/dist/ai/source/ListBox.md +4 -4
- package/dist/ai/source/OptionsContainer.md +4 -4
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +106 -106
- package/dist/components/BbBreadcrumbs/types.d.ts +6 -0
- package/dist/components/BbCalendar/useDayjsLocale.js +5 -3
- package/dist/components/BbCarousel/BbCarousel.vue.d.ts +1 -1
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +506 -481
- package/dist/components/BbCarousel/dragRelease.js +14 -0
- package/dist/components/BbCarousel/ptKeys.generated.d.ts +4 -0
- package/dist/components/BbCarousel/types.d.ts +11 -6
- package/dist/components/BbCarousel/types.js +1 -0
- package/dist/components/BbCheckbox/types.d.ts +2 -4
- package/dist/components/BbCheckboxGroup/types.d.ts +2 -4
- package/dist/components/BbColorInput/types.d.ts +2 -4
- package/dist/components/BbDatePickerInput/types.d.ts +2 -4
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +121 -120
- package/dist/components/BbDropdown/normalizeGroups.js +37 -33
- package/dist/components/BbDropdown/types.d.ts +9 -2
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +95 -94
- package/dist/components/BbGallery/BbGallery.vue.d.ts +50 -0
- package/dist/components/BbGallery/BbGallery.vue.js +5 -0
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +587 -0
- package/dist/components/BbGallery/findItem.js +41 -0
- package/dist/components/BbGallery/ptKeys.generated.d.ts +112 -0
- package/dist/components/BbGallery/types.d.ts +177 -0
- package/dist/components/BbGallery/types.js +29 -0
- package/dist/components/BbNumberInput/types.d.ts +2 -4
- package/dist/components/BbOffCanvas/sheetSnap.d.ts +2 -0
- package/dist/components/BbOffCanvas/sheetSnap.js +5 -5
- package/dist/components/BbRadio/types.d.ts +2 -4
- package/dist/components/BbRadioGroup/types.d.ts +4 -6
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +116 -118
- package/dist/components/BbRating/types.d.ts +2 -4
- package/dist/components/BbSelect/BbSelect.vue.d.ts +10 -4
- package/dist/components/BbSelect/types.d.ts +4 -6
- package/dist/components/BbSlider/types.d.ts +2 -4
- package/dist/components/BbTable/types.d.ts +8 -8
- package/dist/components/BbTag/types.d.ts +2 -4
- package/dist/components/BbTextInput/types.d.ts +2 -4
- package/dist/components/BbTextarea/types.d.ts +2 -4
- package/dist/components/BbTimePickerInput/types.d.ts +2 -4
- package/dist/components/BbTooltip/ptKeys.generated.d.ts +4 -4
- package/dist/components/BbTooltip/types.d.ts +3 -1
- package/dist/components/BbTree/types.d.ts +3 -3
- package/dist/components/CommonField/types.d.ts +2 -4
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +28 -26
- package/dist/composables/overlayRegistry.d.ts +17 -0
- package/dist/composables/overlayRegistry.js +16 -9
- package/dist/composables/useChoiceIndicator.js +66 -63
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/directives/bbDropdown.js +1 -1
- package/dist/directives/bbGallery.d.ts +64 -0
- package/dist/directives/bbGallery.js +38 -0
- package/dist/i18n/locales/ar.json +3 -1
- package/dist/i18n/locales/cs.json +3 -1
- package/dist/i18n/locales/da.json +3 -1
- package/dist/i18n/locales/de-CH.json +3 -1
- package/dist/i18n/locales/de.json +3 -1
- package/dist/i18n/locales/el.json +3 -1
- package/dist/i18n/locales/en-GB.json +3 -1
- package/dist/i18n/locales/en.json +3 -1
- package/dist/i18n/locales/es-MX.json +3 -1
- package/dist/i18n/locales/es.json +3 -1
- package/dist/i18n/locales/fa.json +3 -1
- package/dist/i18n/locales/fi.json +3 -1
- package/dist/i18n/locales/fr.json +3 -1
- package/dist/i18n/locales/he.json +3 -1
- package/dist/i18n/locales/hu.json +3 -1
- package/dist/i18n/locales/it.json +3 -1
- package/dist/i18n/locales/ja.json +3 -1
- package/dist/i18n/locales/ko.json +3 -1
- package/dist/i18n/locales/nb.json +3 -1
- package/dist/i18n/locales/nl.json +3 -1
- package/dist/i18n/locales/pl.json +3 -1
- package/dist/i18n/locales/pt-BR.json +3 -1
- package/dist/i18n/locales/pt-PT.json +3 -1
- package/dist/i18n/locales/ro.json +3 -1
- package/dist/i18n/locales/ru.json +3 -1
- package/dist/i18n/locales/sv.json +3 -1
- package/dist/i18n/locales/tr.json +3 -1
- package/dist/i18n/locales/uk.json +3 -1
- package/dist/i18n/locales/zh-CN.json +3 -1
- package/dist/i18n/locales/zh-HK.json +3 -1
- package/dist/i18n/locales/zh-TW.json +3 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +38 -36
- package/dist/llms-full.txt +2534 -346
- package/dist/llms-medium.txt +10 -7
- package/dist/llms.txt +1 -1
- package/dist/locale-blueprint.json +3 -1
- package/dist/nuxt-auto-imports.js +1 -1
- package/dist/plugin.js +18 -17
- package/dist/project-dts.js +17 -16
- package/dist/runtime/nuxt-plugin.js +22 -21
- package/dist/scripts/lib/atomic-write.js +42 -0
- package/dist/styles.css +2 -2
- package/dist/types/FieldLayout.d.ts +4 -1
- package/dist/types/ItemAccessor.d.ts +3 -1
- package/dist/types/ItemPath.d.ts +33 -0
- package/dist/types/passthrough.d.ts +2 -2
- package/dist/types/ptComponentMap.d.ts +2 -1
- package/dist/utilities/calendar/canonicalParts.js +10 -2
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite.js +361 -331
- package/llms.txt +2 -2
- package/package.json +7 -4
- package/scripts/README.md +31 -29
- package/scripts/lib/agent-refresh.mjs +15 -9
- package/scripts/lib/agent-setup.mjs +46 -15
- package/scripts/lib/atomic-write.d.mts +6 -0
- package/scripts/lib/atomic-write.mjs +85 -0
- package/scripts/lib/define-preset-copy.mjs +24 -4
- package/scripts/lib/eslint-plugin.mjs +74 -36
- package/scripts/lib/hand-imported-styles.mjs +44 -99
- package/scripts/lib/helpers-add.mjs +3 -1
- package/scripts/lib/linked-target.mjs +1 -1
- package/scripts/lib/locale-check.mjs +41 -25
- package/scripts/lib/mcp-config.mjs +250 -133
- package/scripts/lib/mcp-sdk.mjs +24 -0
- package/scripts/lib/plugin-options-check.mjs +22 -15
- package/scripts/lib/pnp.mjs +1 -1
- package/scripts/lib/project-variant-dts.mjs +80 -136
- package/scripts/lib/release-results.mjs +331 -0
- package/scripts/lib/setup.mjs +61 -3
- package/scripts/lib/toolchain-check.mjs +134 -14
- package/scripts/lib/tooling-options.mjs +357 -38
- package/scripts/lib/validate-bb-markup.mjs +1 -1
- package/dist/components/BbBadge/BadgeBodyContent.vue.d.ts +0 -15
- package/dist/components/BbBadge/badgeButtonContext.d.ts +0 -55
- package/dist/components/BbBaseButton/RouterComponent.vue.d.ts +0 -18
- package/dist/components/BbBaseButton/useLinkState.d.ts +0 -43
- package/dist/components/BbBreadcrumbs/estimateBreadcrumbItemWidth.d.ts +0 -18
- package/dist/components/BbButton/toggleRoving.d.ts +0 -6
- package/dist/components/BbCalendar/CalendarMonthPanel.vue.d.ts +0 -5
- package/dist/components/BbCalendar/CalendarYearPanel.vue.d.ts +0 -5
- package/dist/components/BbCalendar/calendarHost.d.ts +0 -29
- package/dist/components/BbCalendar/calendarMath.d.ts +0 -102
- package/dist/components/BbCalendar/useCalendarContext.d.ts +0 -116
- package/dist/components/BbCalendar/useCalendarGrid.d.ts +0 -411
- package/dist/components/BbCalendar/useDayGrid.d.ts +0 -122
- package/dist/components/BbCalendar/useDayjsLocale.d.ts +0 -93
- package/dist/components/BbCalendar/useToday.d.ts +0 -25
- package/dist/components/BbConfirm/BbConfirm.vue.d.ts +0 -4
- package/dist/components/BbConfirm/BbConfirmHost.d.ts +0 -10
- package/dist/components/BbConfirm/confirmEntry.d.ts +0 -4
- package/dist/components/BbDatePickerInput/calendarFields.d.ts +0 -91
- package/dist/components/BbDatePickerInput/dateFieldLayout.d.ts +0 -29
- package/dist/components/BbDialog/useDialogStack.d.ts +0 -19
- package/dist/components/BbDropdown/AdaptiveDropdown.vue.d.ts +0 -26
- package/dist/components/BbDropdown/BbDropdownList.vue.d.ts +0 -38
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue.d.ts +0 -16
- package/dist/components/BbDropdown/DropdownRow.vue.d.ts +0 -41
- package/dist/components/BbDropdown/normalizeGroups.d.ts +0 -39
- package/dist/components/BbDropdown/pointerTrail.d.ts +0 -5
- package/dist/components/BbDropdown/useDropdownContext.d.ts +0 -131
- package/dist/components/BbDropdown/useDropdownGroupRegistry.d.ts +0 -170
- package/dist/components/BbForm/BbFormCustomField.d.ts +0 -14
- package/dist/components/BbForm/bindFormField.d.ts +0 -56
- package/dist/components/BbForm/formFields.d.ts +0 -77
- package/dist/components/BbHost/BbHostOpening.d.ts +0 -27
- package/dist/components/BbHoverCard/hoverCardFocus.d.ts +0 -29
- package/dist/components/BbIcon/iconCache.d.ts +0 -63
- package/dist/components/BbNumberInput/numberDisplay.d.ts +0 -255
- package/dist/components/BbNumberInput/platform.d.ts +0 -7
- package/dist/components/BbOffCanvas/hostCloseLabel.d.ts +0 -3
- package/dist/components/BbOffCanvas/sheetAttrs.d.ts +0 -9
- package/dist/components/BbOffCanvas/useOffCanvasStack.d.ts +0 -37
- package/dist/components/BbPagination/paginationFit.d.ts +0 -38
- package/dist/components/BbSelectPopover/knownItems.d.ts +0 -65
- package/dist/components/BbSelectPopover/reclickClears.d.ts +0 -17
- package/dist/components/BbSelectPopover/sheetChipAttrs.d.ts +0 -18
- package/dist/components/BbTable/BbTableDataRow.d.ts +0 -204
- package/dist/components/BbTable/BbTableEdgeRow.d.ts +0 -112
- package/dist/components/BbTable/BbTableExpandRow.d.ts +0 -84
- package/dist/components/BbTable/BbTableSelectToggle.d.ts +0 -128
- package/dist/components/BbTable/estimatedFloors.golden.d.ts +0 -25
- package/dist/components/BbTable/gridWidgets.d.ts +0 -30
- package/dist/components/BbTable/measuredFloors.d.ts +0 -46
- package/dist/components/BbTable/measuredFloorsTestKit.d.ts +0 -27
- package/dist/components/BbTable/textRuler.d.ts +0 -73
- package/dist/components/BbTable/useRowReorder.d.ts +0 -60
- package/dist/components/BbTable/utils.d.ts +0 -375
- package/dist/components/BbTabs/tablistName.d.ts +0 -4
- package/dist/components/BbToast/BbToast.vue.d.ts +0 -5
- package/dist/components/BbToast/BbToastMessage.vue.d.ts +0 -22
- package/dist/components/BbToast/BbToastRegion.vue.d.ts +0 -15
- package/dist/components/BbTooltip/tooltipWarmup.d.ts +0 -23
- package/dist/components/BbTree/BbTreeLevel.vue.d.ts +0 -19
- package/dist/components/BbTree/context.d.ts +0 -25
- package/dist/components/ChipsBox/ChipsBox.vue.d.ts +0 -21
- package/dist/components/ChipsBox/types.d.ts +0 -28
- package/dist/components/ClearableButton/ClearableButton.vue.d.ts +0 -6
- package/dist/components/ClearableButton/types.d.ts +0 -9
- package/dist/components/CloseIcon/CloseButton.vue.d.ts +0 -7
- package/dist/components/CloseIcon/types.d.ts +0 -2
- package/dist/components/CommaBox/CommaBox.vue.d.ts +0 -21
- package/dist/components/CommaBox/types.d.ts +0 -20
- package/dist/components/CommonField/CommonField.vue.d.ts +0 -20
- package/dist/components/CommonField/messageHeightMatrix.d.ts +0 -2
- package/dist/components/CommonFieldInput/CommonFieldInput.vue.d.ts +0 -22
- package/dist/components/CommonFieldInput/boxBorderMatrix.d.ts +0 -10
- package/dist/components/CommonFieldInput/types.d.ts +0 -114
- package/dist/components/CommonPopover/CommonPopover.vue.d.ts +0 -42
- package/dist/components/CommonPopover/resolvePlacement.d.ts +0 -9
- package/dist/components/CommonPopover/types.d.ts +0 -120
- package/dist/components/CommonTimeSelector/CommonTimeSelector.vue.d.ts +0 -48
- package/dist/components/CommonTimeSelector/useMeridiem.d.ts +0 -19
- package/dist/components/ErrorIcon/ErrorIcon.vue.d.ts +0 -7
- package/dist/components/ErrorIcon/types.d.ts +0 -3
- package/dist/components/FlatListBox/FlatListBox.vue.d.ts +0 -39
- package/dist/components/FlatListBox/types.d.ts +0 -140
- package/dist/components/GroupedListBox/GroupedListBox.vue.d.ts +0 -39
- package/dist/components/GroupedListBox/types.d.ts +0 -163
- package/dist/components/ListBox/ListBox.vue.d.ts +0 -39
- package/dist/components/ListBox/types.d.ts +0 -180
- package/dist/components/OptionsContainer/OptionsContainer.vue.d.ts +0 -20
- package/dist/components/OptionsContainer/types.d.ts +0 -168
- package/dist/components/Transitions/ScaleFade.vue.d.ts +0 -28
- package/dist/components/Transitions/Slide.vue.d.ts +0 -39
- package/dist/components/WarningIcon/WarningIcon.vue.d.ts +0 -7
- package/dist/components/WarningIcon/types.d.ts +0 -3
- package/dist/composables/__testResets.d.ts +0 -1
- package/dist/composables/autoHost.d.ts +0 -22
- package/dist/composables/formSubmitLock.d.ts +0 -48
- package/dist/composables/hostOpenings.d.ts +0 -88
- package/dist/composables/hostRegistry.d.ts +0 -47
- package/dist/composables/ssrMarker.d.ts +0 -15
- package/dist/composables/useActiveInactiveState.d.ts +0 -4
- package/dist/composables/useArray.d.ts +0 -7
- package/dist/composables/useBaseOptions.d.ts +0 -51
- package/dist/composables/useBodyScrollLock.d.ts +0 -4
- package/dist/composables/useBreakpoint.d.ts +0 -13
- package/dist/composables/useCancelableFunction.d.ts +0 -17
- package/dist/composables/useChoiceIndicator.d.ts +0 -58
- package/dist/composables/useClosingInert.d.ts +0 -28
- package/dist/composables/useCoarsePointer.d.ts +0 -9
- package/dist/composables/useCoherence.d.ts +0 -21
- package/dist/composables/useConfig.d.ts +0 -59
- package/dist/composables/useConfigDefaults.d.ts +0 -54
- package/dist/composables/useDirection.d.ts +0 -43
- package/dist/composables/useEscapeStackEntry.d.ts +0 -13
- package/dist/composables/useFrameworkDetection.d.ts +0 -12
- package/dist/composables/useHashedWatcher.d.ts +0 -19
- package/dist/composables/useHydrated.d.ts +0 -37
- package/dist/composables/useImeDismissBlur.d.ts +0 -103
- package/dist/composables/useIndexById.d.ts +0 -11
- package/dist/composables/useInertiaPage.d.ts +0 -10
- package/dist/composables/useItemText.d.ts +0 -17
- package/dist/composables/useItemValue.d.ts +0 -7
- package/dist/composables/useItemsGetter.d.ts +0 -83
- package/dist/composables/useKeyboardInset.d.ts +0 -28
- package/dist/composables/useListboxFocus.d.ts +0 -21
- package/dist/composables/useLocale.d.ts +0 -5
- package/dist/composables/useLogger.d.ts +0 -5
- package/dist/composables/useMinimalQueue.d.ts +0 -9
- package/dist/composables/useOnFalsy.d.ts +0 -2
- package/dist/composables/useOnTruthy.d.ts +0 -7
- package/dist/composables/useOverlayNavigation.d.ts +0 -37
- package/dist/composables/useOverlayYield.d.ts +0 -23
- package/dist/composables/usePrefill.d.ts +0 -44
- package/dist/composables/useQuery.d.ts +0 -39
- package/dist/composables/useRefusedCloseAnnouncement.d.ts +0 -13
- package/dist/composables/useRoute.d.ts +0 -3
- package/dist/composables/useRouter.d.ts +0 -2
- package/dist/composables/useSegmentedFields.d.ts +0 -129
- package/dist/composables/useServerPrefetch.d.ts +0 -28
- package/dist/composables/useSheetSurface.d.ts +0 -39
- package/dist/composables/useSsrState.d.ts +0 -28
- package/dist/composables/useTableWidthContext.d.ts +0 -73
- package/dist/composables/useToggleInput.d.ts +0 -44
- package/dist/composables/useTopLayer.d.ts +0 -9
- package/dist/composables/useTypeahead.d.ts +0 -112
- package/dist/composables/useUntil.d.ts +0 -7
- package/dist/composables/useUrlQueryParam.d.ts +0 -21
- package/dist/composables/useViewportWidth.d.ts +0 -14
- package/dist/deprecation/ai-deprecations.json.d.ts +0 -2984
- package/dist/deprecation/removedProps.d.ts +0 -3
- package/dist/directives/createPopoverDirective.d.ts +0 -111
- package/dist/directives/renderingInstance.d.ts +0 -2
- package/dist/i18n/eraNames.d.ts +0 -2
- package/dist/i18n/regionHints.d.ts +0 -16
- package/dist/icons-whitelist.d.ts +0 -9
- package/dist/reset.d.ts +0 -0
- package/dist/runtime/nuxt-plugin.d.ts +0 -2
- package/dist/styles.d.ts +0 -0
- package/dist/types/ExtractGenericFromComputedRef.d.ts +0 -2
- package/dist/types/ExtractGenericFromRef.d.ts +0 -2
- package/dist/types/NestedKeyOf.d.ts +0 -3
- package/dist/types/PrefixWith.d.ts +0 -1
- package/dist/types/ShapeErased.d.ts +0 -15
- package/dist/types/Simplify.d.ts +0 -6
- package/dist/utilities/calendar/canonicalParts.d.ts +0 -29
- package/dist/utilities/calendar/digits.d.ts +0 -18
- package/dist/utilities/calendar/gregorian.d.ts +0 -2
- package/dist/utilities/calendar/index.d.ts +0 -3
- package/dist/utilities/calendar/international.d.ts +0 -19
- package/dist/utilities/calendar/resolve.d.ts +0 -32
- package/dist/utilities/calendar/runtime.d.ts +0 -49
- package/dist/utilities/functions/animationsSettled.d.ts +0 -7
- package/dist/utilities/functions/bytesToUnit.d.ts +0 -2
- package/dist/utilities/functions/chunk.d.ts +0 -1
- package/dist/utilities/functions/clamp.d.ts +0 -9
- package/dist/utilities/functions/clampPrecision.d.ts +0 -1
- package/dist/utilities/functions/convertDateValue.d.ts +0 -57
- package/dist/utilities/functions/curry.d.ts +0 -6
- package/dist/utilities/functions/deburr.d.ts +0 -1
- package/dist/utilities/functions/elementLabel.d.ts +0 -8
- package/dist/utilities/functions/empty.d.ts +0 -1
- package/dist/utilities/functions/extractDomContainer.d.ts +0 -20
- package/dist/utilities/functions/findInTree.d.ts +0 -4
- package/dist/utilities/functions/flattenTree.d.ts +0 -1
- package/dist/utilities/functions/get.d.ts +0 -3
- package/dist/utilities/functions/hasVnodeListener.d.ts +0 -16
- package/dist/utilities/functions/hash.d.ts +0 -1
- package/dist/utilities/functions/head.d.ts +0 -2
- package/dist/utilities/functions/identity.d.ts +0 -1
- package/dist/utilities/functions/indexBy.d.ts +0 -11
- package/dist/utilities/functions/isDateDisabled.d.ts +0 -25
- package/dist/utilities/functions/isEqual.d.ts +0 -1
- package/dist/utilities/functions/isHex.d.ts +0 -1
- package/dist/utilities/functions/isImeComposing.d.ts +0 -7
- package/dist/utilities/functions/isNil.d.ts +0 -6
- package/dist/utilities/functions/isNotEmpty.d.ts +0 -1
- package/dist/utilities/functions/isNotNil.d.ts +0 -6
- package/dist/utilities/functions/isTextEntry.d.ts +0 -5
- package/dist/utilities/functions/isoWeek.d.ts +0 -36
- package/dist/utilities/functions/itemProps.d.ts +0 -46
- package/dist/utilities/functions/last.d.ts +0 -2
- package/dist/utilities/functions/negative.d.ts +0 -1
- package/dist/utilities/functions/noop.d.ts +0 -1
- package/dist/utilities/functions/normalizeDateBound.d.ts +0 -69
- package/dist/utilities/functions/parsePaginationNumber.d.ts +0 -22
- package/dist/utilities/functions/parseSize.d.ts +0 -3
- package/dist/utilities/functions/parseWidthString.d.ts +0 -6
- package/dist/utilities/functions/percentage.d.ts +0 -26
- package/dist/utilities/functions/pickBy.d.ts +0 -1
- package/dist/utilities/functions/range.d.ts +0 -1
- package/dist/utilities/functions/readableValue.d.ts +0 -6
- package/dist/utilities/functions/reject.d.ts +0 -25
- package/dist/utilities/functions/resolveEnumProp.d.ts +0 -19
- package/dist/utilities/functions/responsiveDefault.d.ts +0 -7
- package/dist/utilities/functions/searchRank.d.ts +0 -19
- package/dist/utilities/functions/settlesVisible.d.ts +0 -20
- package/dist/utilities/functions/snapToStep.d.ts +0 -1
- package/dist/utilities/functions/sort.d.ts +0 -6
- package/dist/utilities/functions/throttle.d.ts +0 -1
- package/dist/utilities/functions/toggleInput.d.ts +0 -114
- package/dist/utilities/functions/transpose.d.ts +0 -1
- package/dist/utilities/functions/validateDateFormat.d.ts +0 -8
- package/dist/utilities/functions/wait.d.ts +0 -2
- package/dist/utilities/functions/waitFor.d.ts +0 -9
- package/dist/utilities/functions/warnRemovedAttrs.d.ts +0 -49
- package/dist/utilities/functions/when.d.ts +0 -9
- package/dist/utilities/misc/autofocus.d.ts +0 -20
- package/dist/utilities/misc/iconsInjectionKey.d.ts +0 -15
- package/dist/utilities/misc/listboxMetrics.d.ts +0 -47
- package/dist/utilities/misc/maskaDataOptions.d.ts +0 -12
- package/dist/utilities/misc/pageText.d.ts +0 -16
- package/dist/utilities/misc/ssrValue.d.ts +0 -20
- package/dist/utilities/misc/transitions.d.ts +0 -5
- package/dist/utils/configDefaults.d.ts +0 -43
- package/dist/utils/configScope.d.ts +0 -43
- package/dist/utils/copyData.d.ts +0 -13
- package/dist/utils/focusVisibility.d.ts +0 -15
- package/dist/utils/injectLibraryStyles.d.ts +0 -8
- package/dist/utils/overlayEscapeStack.d.ts +0 -52
- package/dist/utils/overlaySurfaceIsolation.d.ts +0 -1
- package/dist/utils/passthroughDeduper.d.ts +0 -16
- package/dist/utils/releasedActivator.d.ts +0 -20
- package/dist/utils/versionCheck.d.ts +0 -19
|
@@ -0,0 +1,2034 @@
|
|
|
1
|
+
# BbGallery
|
|
2
|
+
|
|
3
|
+
## Agent Contract
|
|
4
|
+
|
|
5
|
+
- Safety level: **Consumer API**
|
|
6
|
+
- Group: **Data Display**
|
|
7
|
+
- Description: A full-screen photo viewer (lightbox): swipe, arrows, keys, zoom; also the v-bb-gallery directive.
|
|
8
|
+
- Usage rule: Prefer this component for consumer-facing implementations.
|
|
9
|
+
- Implementation source (only when the contract below is not enough): [source/BbGallery.md](./source/BbGallery.md)
|
|
10
|
+
|
|
11
|
+
## Reachable through `BbGallery`
|
|
12
|
+
|
|
13
|
+
`BbGallery` mounts other components (all of them: _Component tree_, near the end). These are the parts of its API that land inside them. Prefer these over `:deep()` on an inner class (a part's class is stable within 3.x, any other class is internal and can break on upgrade) — and never an import of an internal component.
|
|
14
|
+
|
|
15
|
+
| pt part | Lands on | In |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `pt:close` | the root of `CloseButton` | `CloseButton` _(internal)_ |
|
|
18
|
+
|
|
19
|
+
**CSS variables you can set through those parts** — declared deeper in the tree, so set one on the part that reads it (`pt:<part>="[--name:value]"`), never on `BbGallery`'s root:
|
|
20
|
+
|
|
21
|
+
| Variable | Set through | Declared by | What it is |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
| `--size` | `pt:close` | `CloseButton` | the button box — the hit target, not the glyph |
|
|
24
|
+
| `--p` | `pt:close` | `CloseButton` | padding inside that box; what is left of --size is the glyph |
|
|
25
|
+
| `--icon-size` | `pt:close` | `CloseButton` | Glyph: whatever the padding leaves, but never under 10px — a tight --size with the default padding would otherwise collapse it. Declared here, not on the svg: the glyph is a BbIcon, whose own `--size` local would shadow the button's there. |
|
|
26
|
+
|
|
27
|
+
## Usage & Guidelines
|
|
28
|
+
|
|
29
|
+
### When to use
|
|
30
|
+
|
|
31
|
+
Reach for `BbGallery` when a photo deserves the whole screen: a property's
|
|
32
|
+
photos, a trip, a product's shots, a portfolio. It is **only the viewer**: it
|
|
33
|
+
draws nothing on the page. The thumbnails, the carousel, the mosaic or the
|
|
34
|
+
"Show all photos" button are yours, and any of them opens it.
|
|
35
|
+
|
|
36
|
+
Inside, the photos sit on the browser's own scroll-snap track, so a swipe has
|
|
37
|
+
real momentum on a phone and a trackpad. The arrows, ← / → / Home / End, a
|
|
38
|
+
double-click or a pinch to zoom, and a swipe down to close all work out of
|
|
39
|
+
the box.
|
|
40
|
+
|
|
41
|
+
Pick something else when:
|
|
42
|
+
|
|
43
|
+
- The photos should stay on the page and step there → `BbCarousel` (it
|
|
44
|
+
pairs with the gallery: a carousel on the page, the gallery when a photo
|
|
45
|
+
is opened, and a `picker` carousel as the gallery's filmstrip).
|
|
46
|
+
- The content is not photos (a form, a detail panel) → `BbDialog`.
|
|
47
|
+
|
|
48
|
+
### Open it from anything: `v-bb-gallery`
|
|
49
|
+
|
|
50
|
+
Give the gallery an `id` and put `v-bb-gallery` on whatever opens it. `item`
|
|
51
|
+
names the photo: its **index** in `items`, or one of its **URLs** (its `src`,
|
|
52
|
+
or any URL in its `srcset`, relative or absolute). With no `item` it opens on
|
|
53
|
+
the first photo. The trigger gets `aria-haspopup`, `aria-expanded` and
|
|
54
|
+
`aria-controls`, and focus comes back to the trigger on close.
|
|
55
|
+
|
|
56
|
+
**Thumbnails of your own, and a Show all button**
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<template>
|
|
60
|
+
<div class="grid max-w-md grid-cols-4 gap-2">
|
|
61
|
+
<button
|
|
62
|
+
v-for="(photo, i) in photos"
|
|
63
|
+
:key="photo.src"
|
|
64
|
+
v-bb-gallery="{ id: 'trip', item: i }"
|
|
65
|
+
class="overflow-hidden rounded-md"
|
|
66
|
+
type="button"
|
|
67
|
+
>
|
|
68
|
+
<img
|
|
69
|
+
:alt="photo.alt"
|
|
70
|
+
class="aspect-square w-full object-cover"
|
|
71
|
+
:src="photo.src"
|
|
72
|
+
/>
|
|
73
|
+
</button>
|
|
74
|
+
</div>
|
|
75
|
+
<BbButton v-bb-gallery="'trip'" class="mt-3" size="sm" variant="outline">
|
|
76
|
+
Show all {{ photos.length }} photos
|
|
77
|
+
</BbButton>
|
|
78
|
+
<BbGallery id="trip" :items="photos" title="Trip to the mountains" />
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<script setup lang="ts">
|
|
82
|
+
import { BbButton, BbGallery, type BbGalleryItem } from 'bitboss-ui';
|
|
83
|
+
|
|
84
|
+
// Each photo is an inline SVG data URI, so the examples load nothing over the
|
|
85
|
+
// network. Any image URL works here; swap in your own.
|
|
86
|
+
const scene = (sky: string, land: string) =>
|
|
87
|
+
`data:image/svg+xml,${encodeURIComponent(
|
|
88
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1067"><rect width="1600" height="1067" fill="${sky}"/><path d="M0 760 L420 420 L760 700 L1080 360 L1600 820 V1067 H0 Z" fill="${land}"/></svg>`
|
|
89
|
+
)}`;
|
|
90
|
+
|
|
91
|
+
const photos: BbGalleryItem[] = [
|
|
92
|
+
{
|
|
93
|
+
src: scene('#bfdbfe', '#166534'),
|
|
94
|
+
alt: 'A green valley under a pale sky',
|
|
95
|
+
width: 1600,
|
|
96
|
+
height: 1067,
|
|
97
|
+
caption: 'Valley, early morning',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
src: scene('#fed7aa', '#9a3412'),
|
|
101
|
+
alt: 'Red rock walls at sunset',
|
|
102
|
+
width: 1600,
|
|
103
|
+
height: 1067,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
src: scene('#e2e8f0', '#334155'),
|
|
107
|
+
alt: 'Grey peaks in fog',
|
|
108
|
+
width: 1600,
|
|
109
|
+
height: 1067,
|
|
110
|
+
caption: 'The ridge we did not climb',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
src: scene('#1e1b4b', '#0f172a'),
|
|
114
|
+
alt: 'Mountains at night',
|
|
115
|
+
width: 1600,
|
|
116
|
+
height: 1067,
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
</script>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
A URL that names no photo opens nothing, with a dev warning. A thumbnail
|
|
123
|
+
that shows a size the item does not list in its `srcset` is such a miss:
|
|
124
|
+
pass the index, or add the size to the `srcset`.
|
|
125
|
+
|
|
126
|
+
### Or with `v-model`
|
|
127
|
+
|
|
128
|
+
`v-model` is the index of the photo shown, `null` while the viewer is closed.
|
|
129
|
+
Write it to open the viewer on a photo; it follows every swipe, arrow and key,
|
|
130
|
+
and goes back to `null` on close.
|
|
131
|
+
|
|
132
|
+
**v-model, with loop**
|
|
133
|
+
|
|
134
|
+
```vue
|
|
135
|
+
<template>
|
|
136
|
+
<p class="mb-2 text-sm">
|
|
137
|
+
Viewing: {{ index === null ? 'nothing' : photos[index].alt }}
|
|
138
|
+
</p>
|
|
139
|
+
<BbButton size="sm" variant="outline" @click="index = 2">
|
|
140
|
+
Open the third photo
|
|
141
|
+
</BbButton>
|
|
142
|
+
<BbGallery v-model="index" :items="photos" loop title="Controlled" />
|
|
143
|
+
</template>
|
|
144
|
+
|
|
145
|
+
<script setup lang="ts">
|
|
146
|
+
import { ref } from 'vue';
|
|
147
|
+
import { BbButton, BbGallery, type BbGalleryItem } from 'bitboss-ui';
|
|
148
|
+
|
|
149
|
+
// Each photo is an inline SVG data URI, so the examples load nothing over the
|
|
150
|
+
// network. Any image URL works here; swap in your own.
|
|
151
|
+
const scene = (sky: string, land: string) =>
|
|
152
|
+
`data:image/svg+xml,${encodeURIComponent(
|
|
153
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1067"><rect width="1600" height="1067" fill="${sky}"/><path d="M0 760 L420 420 L760 700 L1080 360 L1600 820 V1067 H0 Z" fill="${land}"/></svg>`
|
|
154
|
+
)}`;
|
|
155
|
+
|
|
156
|
+
const photos: BbGalleryItem[] = [
|
|
157
|
+
{
|
|
158
|
+
src: scene('#bfdbfe', '#166534'),
|
|
159
|
+
alt: 'A green valley under a pale sky',
|
|
160
|
+
width: 1600,
|
|
161
|
+
height: 1067,
|
|
162
|
+
caption: 'Valley, early morning',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
src: scene('#fed7aa', '#9a3412'),
|
|
166
|
+
alt: 'Red rock walls at sunset',
|
|
167
|
+
width: 1600,
|
|
168
|
+
height: 1067,
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
src: scene('#e2e8f0', '#334155'),
|
|
172
|
+
alt: 'Grey peaks in fog',
|
|
173
|
+
width: 1600,
|
|
174
|
+
height: 1067,
|
|
175
|
+
caption: 'The ridge we did not climb',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
src: scene('#1e1b4b', '#0f172a'),
|
|
179
|
+
alt: 'Mountains at night',
|
|
180
|
+
width: 1600,
|
|
181
|
+
height: 1067,
|
|
182
|
+
},
|
|
183
|
+
];
|
|
184
|
+
|
|
185
|
+
const index = ref<number | null>(null);
|
|
186
|
+
</script>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
`loop` wraps the ends: next on the last photo goes to the first (buttons,
|
|
190
|
+
keys and a swipe), and the arrows never disable.
|
|
191
|
+
|
|
192
|
+
### The photos
|
|
193
|
+
|
|
194
|
+
Each item takes the same image fields as a `BbCarousel` entry: a `src` (or
|
|
195
|
+
only a `srcset`) and an `alt`; a bare URL string is `{ src }` with an empty
|
|
196
|
+
`alt`. Optionally:
|
|
197
|
+
|
|
198
|
+
- `width` / `height`: the file's own size. With them the photo's box is there
|
|
199
|
+
before the file arrives (a faint plate, no jump when it lands), and a small
|
|
200
|
+
photo is never stretched past its pixels. Pass them when you can.
|
|
201
|
+
- `srcset` / `sizes`: responsive files, as on an `img` (`sizes` defaults to
|
|
202
|
+
`100vw`).
|
|
203
|
+
- `caption`: one line centred in the bottom bar, cut with an ellipsis when
|
|
204
|
+
it runs long. The bar is the same height on every photo, so the photo
|
|
205
|
+
never jumps between a long caption, a short one and none. A caption too
|
|
206
|
+
long for its line gets a "More" button: it runs on upward in place, over
|
|
207
|
+
the foot of the photo (a very long one scrolls), and Escape, a click
|
|
208
|
+
elsewhere or the next photo closes it.
|
|
209
|
+
|
|
210
|
+
The photo shown and its neighbours load at once, the rest lazily. A file that
|
|
211
|
+
fails shows its `alt` in the photo's place (an empty plate when it has none),
|
|
212
|
+
never the browser's broken-image glyph, and is tried again the next time the
|
|
213
|
+
viewer opens.
|
|
214
|
+
|
|
215
|
+
The model is a position: if `items` changes while the viewer is open, it
|
|
216
|
+
stays on the same photo (found by its `src`, else its `srcset`), and if the
|
|
217
|
+
list empties it closes.
|
|
218
|
+
|
|
219
|
+
### Title, header and footer
|
|
220
|
+
|
|
221
|
+
`title` puts a title in the top bar and names the viewer for screen readers;
|
|
222
|
+
without it the bar holds only the close button and the name is "Gallery"
|
|
223
|
+
(localized). The bottom bar holds the photo's caption centred on one line,
|
|
224
|
+
with the counter, "3 / 12", at its end.
|
|
225
|
+
|
|
226
|
+
Three slots, like `BbDialog`'s, replace those bands. Every slot gets `index`,
|
|
227
|
+
`count`, `item` (the photo shown), `go(index)` and `close`:
|
|
228
|
+
|
|
229
|
+
- `#title` replaces the title text (`text` is the prop); it still names the
|
|
230
|
+
viewer. Whatever it holds becomes part of the dialog's spoken name, so
|
|
231
|
+
keep it to a name. It reads well for a plate number or the current room,
|
|
232
|
+
both off the slot's `item`.
|
|
233
|
+
- `#header` replaces the whole bar: put `titleId` on your title and wire your
|
|
234
|
+
own control to `close`.
|
|
235
|
+
- `#footer` replaces the counter with a row of your own across the whole
|
|
236
|
+
bar: your own counter, actions, or a filmstrip that calls `go`. A
|
|
237
|
+
`BbCarousel` with `picker` is that filmstrip: bind it to the slot's
|
|
238
|
+
`index` and send its updates to `go`. The caption keeps its own one-line
|
|
239
|
+
row directly above yours — there whenever any photo has a caption, so
|
|
240
|
+
the photo still never jumps.
|
|
241
|
+
|
|
242
|
+
**A picker carousel as the filmstrip**
|
|
243
|
+
|
|
244
|
+
```vue
|
|
245
|
+
<template>
|
|
246
|
+
<BbButton size="sm" variant="outline" @click="index = 0">
|
|
247
|
+
Open with a filmstrip
|
|
248
|
+
</BbButton>
|
|
249
|
+
<BbGallery v-model="index" :items="photos" title="Filmstrip">
|
|
250
|
+
<template #footer="{ index: shown, go }">
|
|
251
|
+
<BbCarousel
|
|
252
|
+
class="w-full max-w-xl [--gap:6px] [--per-view:5.5] [--ratio:3/2]"
|
|
253
|
+
:items="photos"
|
|
254
|
+
label="Thumbnails"
|
|
255
|
+
:model-value="shown"
|
|
256
|
+
picker
|
|
257
|
+
@update:model-value="go"
|
|
258
|
+
/>
|
|
259
|
+
</template>
|
|
260
|
+
</BbGallery>
|
|
261
|
+
</template>
|
|
262
|
+
|
|
263
|
+
<script setup lang="ts">
|
|
264
|
+
import { ref } from 'vue';
|
|
265
|
+
import { BbButton, BbCarousel, BbGallery } from 'bitboss-ui';
|
|
266
|
+
|
|
267
|
+
// Each photo is an inline SVG data URI, so the examples load nothing over the
|
|
268
|
+
// network. Any image URL works here; swap in your own.
|
|
269
|
+
const scene = (sky: string, land: string) =>
|
|
270
|
+
`data:image/svg+xml,${encodeURIComponent(
|
|
271
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1067"><rect width="1600" height="1067" fill="${sky}"/><path d="M0 760 L420 420 L760 700 L1080 360 L1600 820 V1067 H0 Z" fill="${land}"/></svg>`
|
|
272
|
+
)}`;
|
|
273
|
+
|
|
274
|
+
const photos = [
|
|
275
|
+
{
|
|
276
|
+
src: scene('#bfdbfe', '#166534'),
|
|
277
|
+
alt: 'A green valley under a pale sky',
|
|
278
|
+
width: 1600,
|
|
279
|
+
height: 1067,
|
|
280
|
+
caption: 'Valley, early morning',
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
src: scene('#fed7aa', '#9a3412'),
|
|
284
|
+
alt: 'Red rock walls at sunset',
|
|
285
|
+
width: 1600,
|
|
286
|
+
height: 1067,
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
src: scene('#e2e8f0', '#334155'),
|
|
290
|
+
alt: 'Grey peaks in fog',
|
|
291
|
+
width: 1600,
|
|
292
|
+
height: 1067,
|
|
293
|
+
caption: 'The ridge we did not climb',
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
src: scene('#1e1b4b', '#0f172a'),
|
|
297
|
+
alt: 'Mountains at night',
|
|
298
|
+
width: 1600,
|
|
299
|
+
height: 1067,
|
|
300
|
+
},
|
|
301
|
+
];
|
|
302
|
+
|
|
303
|
+
const index = ref<number | null>(null);
|
|
304
|
+
</script>
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### Zoom and gestures
|
|
308
|
+
|
|
309
|
+
| Input | Does |
|
|
310
|
+
| ------------------------------------ | ----------------------------------- |
|
|
311
|
+
| Swipe, trackpad, ← / →, the arrows | Previous / next photo |
|
|
312
|
+
| Home / End | First / last photo |
|
|
313
|
+
| Double-click, double tap | Zoom in at that point / back to fit |
|
|
314
|
+
| Pinch, ctrl + wheel, trackpad pinch | Zoom |
|
|
315
|
+
| `+` / `-` / `0` | Zoom in / out / back to fit |
|
|
316
|
+
| Drag, wheel or trackpad while zoomed | Pan |
|
|
317
|
+
| Swipe down (touch), Escape | Close |
|
|
318
|
+
| Tap (touch) | Hide / show the bars and arrows |
|
|
319
|
+
|
|
320
|
+
Zoom goes up to the file's own pixels (at least 2×, at most 4×) and resets
|
|
321
|
+
on the next photo. A click on the dark area around the photo does nothing
|
|
322
|
+
unless you opt in (off by default: a click aimed at an arrow that has just
|
|
323
|
+
disabled at the last photo lands there, and should not close the viewer):
|
|
324
|
+
|
|
325
|
+
```vue
|
|
326
|
+
<BbGallery v-model="index" :items="photos" close-on-backdrop-click />
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
The viewer fades in and out over the whole screen, and the
|
|
330
|
+
next photo fades in where it stands; only a swipe moves the photos sideways.
|
|
331
|
+
Under `prefers-reduced-motion` the photos change at once.
|
|
332
|
+
|
|
333
|
+
### Restyling with passthrough
|
|
334
|
+
|
|
335
|
+
Every part lives in the viewer: `root` (the full-screen `dialog`), `header`,
|
|
336
|
+
`title`, `close`, `slide`, `image`,
|
|
337
|
+
`caption` (its line in the bar, and the full text when opened),
|
|
338
|
+
`prev`, `next`, `footer`, `counter`, `more` (the button that opens it,
|
|
339
|
+
there only while a caption overflows its line). `slide` takes `active` on
|
|
340
|
+
the photo shown, `prev` / `next` take `disabled` at the ends, and `zoomed`
|
|
341
|
+
is viewer-wide (`pt:header:zoomed="opacity-0"` hides the bar while zoomed).
|
|
342
|
+
|
|
343
|
+
Every colour in the viewer follows two locals on the root: `--viewer-bg`
|
|
344
|
+
(its plate) and `--viewer-fg` (its text). The muted text softens the ink,
|
|
345
|
+
the arrows sit on the plate colour, so a light viewer is those two plus
|
|
346
|
+
`color-scheme: light`. Set `--viewer-muted` or `--plate` (the arrows'
|
|
347
|
+
ground) directly when a derived colour is not the one you want.
|
|
348
|
+
`--nav-size` sizes the round buttons.
|
|
349
|
+
|
|
350
|
+
Reach for utilities first: `pt` classes land on the parts themselves, so a
|
|
351
|
+
font, a size or a colour needs no stylesheet at all.
|
|
352
|
+
|
|
353
|
+
```vue
|
|
354
|
+
<BbGallery
|
|
355
|
+
id="trip"
|
|
356
|
+
:items="photos"
|
|
357
|
+
pt:caption="font-serif italic"
|
|
358
|
+
pt:root="[--viewer-bg:rgb(250_248_244)] [--viewer-fg:rgb(28_25_23)] [color-scheme:light]"
|
|
359
|
+
pt:title="font-serif text-2xl"
|
|
360
|
+
/>
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
Only structural CSS — a descendant selector, a pseudo-element, one face for
|
|
364
|
+
the whole viewer — needs the second route. A scoped `<style>` does not
|
|
365
|
+
reach the viewer: it opens in the top layer, outside your component's
|
|
366
|
+
markup. Name the root with `pt:root="my-viewer"` and restyle it from an
|
|
367
|
+
unscoped `<style>`, as the pages below do.
|
|
368
|
+
|
|
369
|
+
### Designed pages
|
|
370
|
+
|
|
371
|
+
Four whole pages, each with its own type and palette, and a viewer dressed to
|
|
372
|
+
match. The page draws the photos its own way; the gallery only opens them.
|
|
373
|
+
|
|
374
|
+
A holiday house: a five-tile mosaic opening on the photo clicked, a "Show
|
|
375
|
+
all" button, and a light viewer in the page's own type.
|
|
376
|
+
|
|
377
|
+
**A holiday house: mosaic, Show all, a light viewer**
|
|
378
|
+
|
|
379
|
+
```vue
|
|
380
|
+
<template>
|
|
381
|
+
<article class="casa">
|
|
382
|
+
<header class="casa__head">
|
|
383
|
+
<h2 class="casa__name">Casa Calma</h2>
|
|
384
|
+
<p class="casa__where">
|
|
385
|
+
A whitewashed house above the sea · 2 bedrooms · sleeps 4
|
|
386
|
+
</p>
|
|
387
|
+
</header>
|
|
388
|
+
|
|
389
|
+
<!-- The mosaic is the page's own markup: five tiles, each opening the
|
|
390
|
+
viewer on its photo by URL; the button names no photo (the first). -->
|
|
391
|
+
<div class="casa__mosaic">
|
|
392
|
+
<button
|
|
393
|
+
v-for="(p, i) in house.slice(0, 5)"
|
|
394
|
+
:key="p.src"
|
|
395
|
+
v-bb-gallery="{ id: 'casa', item: p.src }"
|
|
396
|
+
class="casa__tile"
|
|
397
|
+
:class="{ 'casa__tile--hero': i === 0 }"
|
|
398
|
+
type="button"
|
|
399
|
+
>
|
|
400
|
+
<img
|
|
401
|
+
:alt="p.alt"
|
|
402
|
+
decoding="async"
|
|
403
|
+
:sizes="i === 0 ? '(min-width: 960px) 560px, 100vw' : '280px'"
|
|
404
|
+
:src="p.thumb"
|
|
405
|
+
:srcset="p.srcset"
|
|
406
|
+
/>
|
|
407
|
+
</button>
|
|
408
|
+
<button v-bb-gallery="'casa'" class="casa__all" type="button">
|
|
409
|
+
<svg aria-hidden="true" viewBox="0 0 20 20">
|
|
410
|
+
<path d="M3 3h5v5H3zM12 3h5v5h-5zM3 12h5v5H3zM12 12h5v5h-5z" />
|
|
411
|
+
</svg>
|
|
412
|
+
Show all {{ house.length }} photos
|
|
413
|
+
</button>
|
|
414
|
+
</div>
|
|
415
|
+
|
|
416
|
+
<div class="casa__body">
|
|
417
|
+
<p>
|
|
418
|
+
Three rooms off a small courtyard, whitewashed every spring, with a
|
|
419
|
+
terrace that catches the morning sun and the evening wind. The lane
|
|
420
|
+
outside runs down to the water in two minutes.
|
|
421
|
+
</p>
|
|
422
|
+
<p class="casa__price"><strong>€ 240</strong> night</p>
|
|
423
|
+
</div>
|
|
424
|
+
|
|
425
|
+
<BbGallery
|
|
426
|
+
id="casa"
|
|
427
|
+
:items="house"
|
|
428
|
+
pt:root="casa__viewer"
|
|
429
|
+
title="Casa Calma"
|
|
430
|
+
/>
|
|
431
|
+
</article>
|
|
432
|
+
</template>
|
|
433
|
+
|
|
434
|
+
<script setup lang="ts">
|
|
435
|
+
import { BbGallery, vBbGallery } from 'bitboss-ui';
|
|
436
|
+
|
|
437
|
+
// Real photographs from picsum.photos (Unsplash licence). Each gets a srcset at
|
|
438
|
+
// its own ratio and its intrinsic size, which is all BbGallery needs to
|
|
439
|
+
// reserve the box and pick the right file; `thumb` is for the page's tiles.
|
|
440
|
+
const picsum = (id: number, w: number, h: number) => {
|
|
441
|
+
const at = (x: number) =>
|
|
442
|
+
`https://picsum.photos/id/${id}/${x}/${Math.round((x * h) / w)}`;
|
|
443
|
+
const width = Math.min(2400, w);
|
|
444
|
+
return {
|
|
445
|
+
src: at(Math.min(1600, w)),
|
|
446
|
+
srcset: [800, 1600, 2400]
|
|
447
|
+
.filter((x) => x <= w)
|
|
448
|
+
.map((x) => `${at(x)} ${x}w`)
|
|
449
|
+
.join(', '),
|
|
450
|
+
width,
|
|
451
|
+
height: Math.round((width * h) / w),
|
|
452
|
+
thumb: at(640),
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
const house = [
|
|
457
|
+
{
|
|
458
|
+
...picsum(947, 5000, 3333),
|
|
459
|
+
alt: 'A whitewashed house with a small dome and a clay pot, against a deep blue sky',
|
|
460
|
+
caption: 'The house, from the lane',
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
...picsum(1068, 5000, 2873),
|
|
464
|
+
alt: 'A small white table with a potted plant against a bright blue wall',
|
|
465
|
+
caption: 'Terrace · morning coffee corner',
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
...picsum(625, 2507, 1674),
|
|
469
|
+
alt: 'A wooden dining table with white chairs in a bright room',
|
|
470
|
+
caption: 'Dining room · seats six',
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
...picsum(691, 3000, 2000),
|
|
474
|
+
alt: 'A green mug on crumpled white bed sheets',
|
|
475
|
+
caption: 'Main bedroom · king bed, linen sheets',
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
...picsum(431, 5000, 3334),
|
|
479
|
+
alt: 'A cappuccino on a wooden table, a bell and a note beside it',
|
|
480
|
+
caption: 'Breakfast is left at the door',
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
...picsum(1059, 5000, 3337),
|
|
484
|
+
alt: 'Coats and a shirt on hooks along a wooden wall, a shelf of boxes below',
|
|
485
|
+
caption: 'Entrance · storage for luggage and coats',
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
...picsum(1065, 3333, 5000),
|
|
489
|
+
alt: 'A narrow stone lane between old walls, the sea at its end',
|
|
490
|
+
caption: 'Two minutes down this lane to the water',
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
...picsum(853, 3000, 1993),
|
|
494
|
+
alt: 'A lone rock in a calm, pale blue sea',
|
|
495
|
+
caption: 'The view from the terrace',
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
...picsum(49, 1280, 792),
|
|
499
|
+
alt: 'White houses and windmills along a clifftop village',
|
|
500
|
+
caption: 'The village at the top of the hill',
|
|
501
|
+
},
|
|
502
|
+
];
|
|
503
|
+
</script>
|
|
504
|
+
|
|
505
|
+
<style scoped>
|
|
506
|
+
.casa {
|
|
507
|
+
--ink: #2a2420;
|
|
508
|
+
--stone: #f3eee5;
|
|
509
|
+
--line: #d9cfbf;
|
|
510
|
+
--clay: #a8492a;
|
|
511
|
+
background: var(--stone);
|
|
512
|
+
color: var(--ink);
|
|
513
|
+
font-family: 'Hanken Grotesk', sans-serif;
|
|
514
|
+
padding: clamp(24px, 5vw, 64px) clamp(16px, 5vw, 64px) 72px;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.casa__head {
|
|
518
|
+
margin-bottom: 28px;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.casa__name {
|
|
522
|
+
font-family: 'Gloock', serif;
|
|
523
|
+
font-size: clamp(2.75rem, 7vw, 5rem);
|
|
524
|
+
font-weight: 400;
|
|
525
|
+
letter-spacing: -0.02em;
|
|
526
|
+
line-height: 0.95;
|
|
527
|
+
margin: 0;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.casa__where {
|
|
531
|
+
color: color-mix(in oklab, var(--ink) 75%, var(--stone));
|
|
532
|
+
font-size: 1rem;
|
|
533
|
+
margin: 12px 0 0;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.casa__mosaic {
|
|
537
|
+
display: grid;
|
|
538
|
+
gap: 8px;
|
|
539
|
+
grid-template-columns: 2fr 1fr 1fr;
|
|
540
|
+
grid-template-rows: repeat(2, minmax(0, 1fr));
|
|
541
|
+
height: clamp(320px, 46vw, 520px);
|
|
542
|
+
position: relative;
|
|
543
|
+
|
|
544
|
+
@media (max-width: 640px) {
|
|
545
|
+
grid-template-columns: 1fr 1fr;
|
|
546
|
+
grid-template-rows: 2fr 1fr;
|
|
547
|
+
height: 460px;
|
|
548
|
+
|
|
549
|
+
.casa__tile:nth-child(n + 4) {
|
|
550
|
+
display: none;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.casa__tile {
|
|
556
|
+
background: var(--line);
|
|
557
|
+
border: 0;
|
|
558
|
+
border-radius: 4px;
|
|
559
|
+
cursor: zoom-in;
|
|
560
|
+
overflow: hidden;
|
|
561
|
+
padding: 0;
|
|
562
|
+
|
|
563
|
+
img {
|
|
564
|
+
display: block;
|
|
565
|
+
height: 100%;
|
|
566
|
+
object-fit: cover;
|
|
567
|
+
transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
568
|
+
width: 100%;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
&:hover img {
|
|
572
|
+
transform: scale(1.03);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
&:focus-visible {
|
|
576
|
+
outline: 2px solid var(--clay);
|
|
577
|
+
outline-offset: 3px;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.casa__tile--hero {
|
|
582
|
+
border-radius: 14px 4px 4px 14px;
|
|
583
|
+
grid-row: span 2;
|
|
584
|
+
|
|
585
|
+
@media (max-width: 640px) {
|
|
586
|
+
border-radius: 14px 14px 4px 4px;
|
|
587
|
+
grid-column: span 2;
|
|
588
|
+
grid-row: auto;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.casa__mosaic .casa__tile:nth-child(3) {
|
|
593
|
+
border-start-end-radius: 14px;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.casa__mosaic .casa__tile:nth-child(5) {
|
|
597
|
+
border-end-end-radius: 14px;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.casa__all {
|
|
601
|
+
align-items: center;
|
|
602
|
+
background: var(--stone);
|
|
603
|
+
border: 1px solid var(--ink);
|
|
604
|
+
border-radius: 999px;
|
|
605
|
+
bottom: 16px;
|
|
606
|
+
box-shadow: 0 6px 20px -8px rgb(42 36 32 / 0.45);
|
|
607
|
+
color: var(--ink);
|
|
608
|
+
cursor: pointer;
|
|
609
|
+
display: inline-flex;
|
|
610
|
+
font:
|
|
611
|
+
500 0.875rem/1 'Hanken Grotesk',
|
|
612
|
+
sans-serif;
|
|
613
|
+
gap: 8px;
|
|
614
|
+
inset-inline-end: 16px;
|
|
615
|
+
padding: 10px 16px;
|
|
616
|
+
position: absolute;
|
|
617
|
+
transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
618
|
+
|
|
619
|
+
svg {
|
|
620
|
+
fill: currentColor;
|
|
621
|
+
height: 14px;
|
|
622
|
+
width: 14px;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
&:hover {
|
|
626
|
+
transform: translateY(-1px);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
&:focus-visible {
|
|
630
|
+
outline: 2px solid var(--clay);
|
|
631
|
+
outline-offset: 3px;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.casa__body {
|
|
636
|
+
align-items: baseline;
|
|
637
|
+
border-top: 1px solid var(--line);
|
|
638
|
+
display: flex;
|
|
639
|
+
flex-wrap: wrap;
|
|
640
|
+
gap: 16px 48px;
|
|
641
|
+
justify-content: space-between;
|
|
642
|
+
margin-top: 32px;
|
|
643
|
+
padding-top: 24px;
|
|
644
|
+
|
|
645
|
+
p {
|
|
646
|
+
font-size: 1.0625rem;
|
|
647
|
+
line-height: 1.6;
|
|
648
|
+
margin: 0;
|
|
649
|
+
max-width: 60ch;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.casa__price {
|
|
654
|
+
font-size: 1rem;
|
|
655
|
+
white-space: nowrap;
|
|
656
|
+
|
|
657
|
+
strong {
|
|
658
|
+
font-family: 'Gloock', serif;
|
|
659
|
+
font-size: 2rem;
|
|
660
|
+
font-weight: 400;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
</style>
|
|
664
|
+
|
|
665
|
+
<!-- The viewer is in the top layer, outside this component's scope: its
|
|
666
|
+
restyle is global, keyed on the pt classes. -->
|
|
667
|
+
<style>
|
|
668
|
+
/* Self-host the face named below (@font-face) in your app; until then it falls back to the system stack. */
|
|
669
|
+
|
|
670
|
+
.casa__viewer {
|
|
671
|
+
--viewer-bg: #f3eee5;
|
|
672
|
+
--viewer-fg: #2a2420;
|
|
673
|
+
color-scheme: light;
|
|
674
|
+
font-family: 'Hanken Grotesk', sans-serif;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
.casa__viewer .bb-gallery__title {
|
|
678
|
+
font-family: 'Gloock', serif;
|
|
679
|
+
font-size: 1.5rem;
|
|
680
|
+
font-weight: 400;
|
|
681
|
+
}
|
|
682
|
+
</style>
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
A product page: the page's carousel and its picker share one `v-model`, the
|
|
686
|
+
zoom button opens the viewer on the slide shown, and the viewer hands the
|
|
687
|
+
photo it closes on back to the carousel. Its footer is a picker filmstrip.
|
|
688
|
+
|
|
689
|
+
**A product page: carousel, picker, a filmstrip in the viewer**
|
|
690
|
+
|
|
691
|
+
```vue
|
|
692
|
+
<template>
|
|
693
|
+
<article class="ferro">
|
|
694
|
+
<div class="ferro__media">
|
|
695
|
+
<!-- The page's carousel and its picker share one v-model; a click on
|
|
696
|
+
the big photo opens the viewer there, and the viewer hands the
|
|
697
|
+
photo it closes on back to the carousel. -->
|
|
698
|
+
<BbCarousel
|
|
699
|
+
v-model="at"
|
|
700
|
+
class="ferro__stage [--ratio:4/3]"
|
|
701
|
+
:items="
|
|
702
|
+
coffee.map((p) => ({
|
|
703
|
+
src: p.src,
|
|
704
|
+
srcset: p.srcset,
|
|
705
|
+
alt: p.alt,
|
|
706
|
+
sizes: '(min-width: 960px) 600px, 100vw',
|
|
707
|
+
}))
|
|
708
|
+
"
|
|
709
|
+
label="Huila, Colombia — photos"
|
|
710
|
+
>
|
|
711
|
+
<template #overlay="{ index }">
|
|
712
|
+
<button
|
|
713
|
+
v-bb-gallery="{ id: 'beans', item: index }"
|
|
714
|
+
:aria-label="`View photo ${index + 1} full screen`"
|
|
715
|
+
class="ferro__zoom"
|
|
716
|
+
type="button"
|
|
717
|
+
>
|
|
718
|
+
<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
719
|
+
<circle cx="11" cy="11" r="6.5" />
|
|
720
|
+
<path d="M16 16l4.5 4.5M11 8v6M8 11h6" />
|
|
721
|
+
</svg>
|
|
722
|
+
</button>
|
|
723
|
+
</template>
|
|
724
|
+
</BbCarousel>
|
|
725
|
+
<BbCarousel
|
|
726
|
+
v-model="at"
|
|
727
|
+
class="ferro__picker [--gap:10px] [--per-view:5] [--r:4px] [--ratio:1]"
|
|
728
|
+
:items="thumbs"
|
|
729
|
+
label="Choose a photo"
|
|
730
|
+
picker
|
|
731
|
+
/>
|
|
732
|
+
</div>
|
|
733
|
+
|
|
734
|
+
<div class="ferro__info">
|
|
735
|
+
<h2 class="ferro__name">Huila, Colombia</h2>
|
|
736
|
+
<p class="ferro__notes">
|
|
737
|
+
Single origin from Ferro Roasters. Panela, red apple, cocoa nib.
|
|
738
|
+
</p>
|
|
739
|
+
<p class="ferro__price">€ 16.50 <span>/ 250 g</span></p>
|
|
740
|
+
|
|
741
|
+
<fieldset class="ferro__grind">
|
|
742
|
+
<legend>Grind</legend>
|
|
743
|
+
<label v-for="g in grinds" :key="g">
|
|
744
|
+
<input v-model="grind" name="grind" type="radio" :value="g" />
|
|
745
|
+
<span>{{ g }}</span>
|
|
746
|
+
</label>
|
|
747
|
+
</fieldset>
|
|
748
|
+
|
|
749
|
+
<BbButton block class="ferro__buy" size="lg">Add to bag</BbButton>
|
|
750
|
+
|
|
751
|
+
<dl class="ferro__facts">
|
|
752
|
+
<div>
|
|
753
|
+
<dt>Process</dt>
|
|
754
|
+
<dd>Washed, 36 h ferment</dd>
|
|
755
|
+
</div>
|
|
756
|
+
<div>
|
|
757
|
+
<dt>Altitude</dt>
|
|
758
|
+
<dd>1,750 – 1,900 m</dd>
|
|
759
|
+
</div>
|
|
760
|
+
<div>
|
|
761
|
+
<dt>Roasted</dt>
|
|
762
|
+
<dd>Every Tuesday</dd>
|
|
763
|
+
</div>
|
|
764
|
+
</dl>
|
|
765
|
+
</div>
|
|
766
|
+
|
|
767
|
+
<BbGallery
|
|
768
|
+
id="beans"
|
|
769
|
+
:items="coffee"
|
|
770
|
+
pt:root="ferro__viewer"
|
|
771
|
+
title="Huila, Colombia"
|
|
772
|
+
@update:model-value="follow"
|
|
773
|
+
>
|
|
774
|
+
<template #footer="{ index, go }">
|
|
775
|
+
<BbCarousel
|
|
776
|
+
class="ferro__film [--gap:8px] [--per-view:5] [--r:4px] [--ratio:1]"
|
|
777
|
+
:items="thumbs"
|
|
778
|
+
label="Photos"
|
|
779
|
+
:model-value="index"
|
|
780
|
+
picker
|
|
781
|
+
@update:model-value="go"
|
|
782
|
+
/>
|
|
783
|
+
</template>
|
|
784
|
+
</BbGallery>
|
|
785
|
+
</article>
|
|
786
|
+
</template>
|
|
787
|
+
|
|
788
|
+
<script setup lang="ts">
|
|
789
|
+
import { ref } from 'vue';
|
|
790
|
+
import { BbButton, BbCarousel, BbGallery, vBbGallery } from 'bitboss-ui';
|
|
791
|
+
|
|
792
|
+
// Real photographs from picsum.photos (Unsplash licence). Each gets a srcset at
|
|
793
|
+
// its own ratio and its intrinsic size, which is all BbGallery needs to
|
|
794
|
+
// reserve the box and pick the right file; `thumb` is for the pickers.
|
|
795
|
+
const picsum = (id: number, w: number, h: number) => {
|
|
796
|
+
const at = (x: number) =>
|
|
797
|
+
`https://picsum.photos/id/${id}/${x}/${Math.round((x * h) / w)}`;
|
|
798
|
+
const width = Math.min(2400, w);
|
|
799
|
+
return {
|
|
800
|
+
src: at(Math.min(1600, w)),
|
|
801
|
+
srcset: [800, 1600, 2400]
|
|
802
|
+
.filter((x) => x <= w)
|
|
803
|
+
.map((x) => `${at(x)} ${x}w`)
|
|
804
|
+
.join(', '),
|
|
805
|
+
width,
|
|
806
|
+
height: Math.round((width * h) / w),
|
|
807
|
+
thumb: at(640),
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
const coffee = [
|
|
812
|
+
{
|
|
813
|
+
...picsum(766, 5000, 3337),
|
|
814
|
+
alt: 'Dark roasted coffee beans filling the frame',
|
|
815
|
+
caption: 'Medium-dark roast, roasted to order',
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
...picsum(1060, 5000, 3333),
|
|
819
|
+
alt: 'Coffee brewing through a pour-over dripper into a glass carafe',
|
|
820
|
+
caption: 'Best as a pour-over: 15 g to 250 ml at 94 °C',
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
...picsum(431, 5000, 3334),
|
|
824
|
+
alt: 'A cappuccino on a wooden table',
|
|
825
|
+
caption: 'Holds up in milk',
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
...picsum(63, 5000, 2813),
|
|
829
|
+
alt: 'A white cup of coffee on a bright red surface, seen from above',
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
...picsum(425, 959, 635),
|
|
833
|
+
alt: 'Roasted coffee beans scattered on a pale table',
|
|
834
|
+
},
|
|
835
|
+
];
|
|
836
|
+
const thumbs = coffee.map(({ thumb, alt }) => ({ src: thumb, alt }));
|
|
837
|
+
|
|
838
|
+
const at = ref(0);
|
|
839
|
+
/** The page's carousel rests on the photo the viewer was showing. */
|
|
840
|
+
const follow = (i: number | null) => {
|
|
841
|
+
if (i !== null) at.value = i;
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
const grinds = ['Whole bean', 'Filter', 'Espresso'];
|
|
845
|
+
const grind = ref('Whole bean');
|
|
846
|
+
</script>
|
|
847
|
+
|
|
848
|
+
<style scoped>
|
|
849
|
+
.ferro {
|
|
850
|
+
--ink: #16130f;
|
|
851
|
+
--paper: #fbfaf7;
|
|
852
|
+
--rule: #e6e1d8;
|
|
853
|
+
--ember: #c2410c;
|
|
854
|
+
background: var(--paper);
|
|
855
|
+
color: var(--ink);
|
|
856
|
+
display: grid;
|
|
857
|
+
font-family: 'Bricolage Grotesque', sans-serif;
|
|
858
|
+
gap: clamp(28px, 5vw, 72px);
|
|
859
|
+
grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr);
|
|
860
|
+
padding: clamp(24px, 5vw, 64px) clamp(16px, 5vw, 64px) 72px;
|
|
861
|
+
|
|
862
|
+
@media (max-width: 860px) {
|
|
863
|
+
grid-template-columns: 1fr;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.ferro__media {
|
|
868
|
+
display: grid;
|
|
869
|
+
gap: 12px;
|
|
870
|
+
min-width: 0;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.ferro__stage {
|
|
874
|
+
--r: 6px;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
.ferro__zoom {
|
|
878
|
+
background: transparent;
|
|
879
|
+
border: 0;
|
|
880
|
+
cursor: zoom-in;
|
|
881
|
+
inset: 0;
|
|
882
|
+
padding: 0;
|
|
883
|
+
position: absolute;
|
|
884
|
+
|
|
885
|
+
svg {
|
|
886
|
+
background: rgb(251 250 247 / 0.92);
|
|
887
|
+
border-radius: 999px;
|
|
888
|
+
bottom: 14px;
|
|
889
|
+
box-shadow: 0 4px 14px -6px rgb(22 19 15 / 0.5);
|
|
890
|
+
fill: none;
|
|
891
|
+
height: 40px;
|
|
892
|
+
inset-inline-end: 14px;
|
|
893
|
+
opacity: 0;
|
|
894
|
+
padding: 9px;
|
|
895
|
+
position: absolute;
|
|
896
|
+
stroke: var(--ink);
|
|
897
|
+
stroke-linecap: round;
|
|
898
|
+
stroke-width: 1.8;
|
|
899
|
+
transition: opacity 200ms ease-out;
|
|
900
|
+
width: 40px;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
&:hover svg,
|
|
904
|
+
&:focus-visible svg {
|
|
905
|
+
opacity: 1;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
&:focus-visible {
|
|
909
|
+
outline: 2px solid var(--ember);
|
|
910
|
+
outline-offset: -4px;
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
.ferro__info {
|
|
915
|
+
align-self: start;
|
|
916
|
+
position: sticky;
|
|
917
|
+
top: 24px;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
.ferro__name {
|
|
921
|
+
font-size: clamp(2.25rem, 4.5vw, 3.5rem);
|
|
922
|
+
font-variation-settings: 'opsz' 96;
|
|
923
|
+
font-weight: 800;
|
|
924
|
+
letter-spacing: -0.035em;
|
|
925
|
+
line-height: 1;
|
|
926
|
+
margin: 0;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
.ferro__notes {
|
|
930
|
+
color: #57514a;
|
|
931
|
+
font-size: 1.125rem;
|
|
932
|
+
margin: 12px 0 24px;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
.ferro__price {
|
|
936
|
+
font-size: 1.75rem;
|
|
937
|
+
font-variant-numeric: tabular-nums;
|
|
938
|
+
font-weight: 700;
|
|
939
|
+
margin: 0 0 28px;
|
|
940
|
+
|
|
941
|
+
span {
|
|
942
|
+
color: #57514a;
|
|
943
|
+
font-size: 1rem;
|
|
944
|
+
font-weight: 400;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
.ferro__grind {
|
|
949
|
+
border: 0;
|
|
950
|
+
display: flex;
|
|
951
|
+
flex-wrap: wrap;
|
|
952
|
+
gap: 8px;
|
|
953
|
+
margin: 0 0 20px;
|
|
954
|
+
padding: 0;
|
|
955
|
+
|
|
956
|
+
legend {
|
|
957
|
+
font-size: 0.875rem;
|
|
958
|
+
font-weight: 600;
|
|
959
|
+
margin-bottom: 10px;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
label {
|
|
963
|
+
cursor: pointer;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
input {
|
|
967
|
+
opacity: 0;
|
|
968
|
+
position: absolute;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
span {
|
|
972
|
+
border: 1px solid var(--rule);
|
|
973
|
+
border-radius: 999px;
|
|
974
|
+
display: inline-block;
|
|
975
|
+
font-size: 0.9375rem;
|
|
976
|
+
padding: 9px 16px;
|
|
977
|
+
transition:
|
|
978
|
+
border-color 150ms ease-out,
|
|
979
|
+
background-color 150ms ease-out;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
input:checked + span {
|
|
983
|
+
background: var(--ink);
|
|
984
|
+
border-color: var(--ink);
|
|
985
|
+
color: var(--paper);
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
input:focus-visible + span {
|
|
989
|
+
outline: 2px solid var(--ember);
|
|
990
|
+
outline-offset: 2px;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
.ferro__buy {
|
|
995
|
+
margin-bottom: 28px;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
.ferro__facts {
|
|
999
|
+
border-top: 1px solid var(--rule);
|
|
1000
|
+
margin: 0;
|
|
1001
|
+
|
|
1002
|
+
div {
|
|
1003
|
+
border-bottom: 1px solid var(--rule);
|
|
1004
|
+
display: flex;
|
|
1005
|
+
font-size: 0.9375rem;
|
|
1006
|
+
justify-content: space-between;
|
|
1007
|
+
padding: 12px 0;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
dt {
|
|
1011
|
+
color: #57514a;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
dd {
|
|
1015
|
+
margin: 0;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
</style>
|
|
1019
|
+
|
|
1020
|
+
<!-- The viewer is in the top layer, outside this component's scope: its
|
|
1021
|
+
restyle is global, keyed on the pt classes. -->
|
|
1022
|
+
<style>
|
|
1023
|
+
/* Self-host the face named below (@font-face) in your app; until then it falls back to the system stack. */
|
|
1024
|
+
|
|
1025
|
+
.ferro__viewer {
|
|
1026
|
+
--viewer-bg: #fbfaf7;
|
|
1027
|
+
--viewer-fg: #16130f;
|
|
1028
|
+
/* A near-solid paper disc under the arrows (the derived plate is the
|
|
1029
|
+
background at half strength). */
|
|
1030
|
+
--plate: rgb(251 250 247 / 0.85);
|
|
1031
|
+
color-scheme: light;
|
|
1032
|
+
font-family: 'Bricolage Grotesque', sans-serif;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
.ferro__viewer .bb-gallery__title {
|
|
1036
|
+
font-weight: 700;
|
|
1037
|
+
letter-spacing: -0.01em;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
.ferro__film {
|
|
1041
|
+
margin-inline: auto;
|
|
1042
|
+
width: min(100%, 420px);
|
|
1043
|
+
}
|
|
1044
|
+
</style>
|
|
1045
|
+
```
|
|
1046
|
+
|
|
1047
|
+
A photo essay: figures in the flow of the text, each opening the same
|
|
1048
|
+
gallery, its long captions one line in the bar and in full from "More",
|
|
1049
|
+
and the credit in the footer.
|
|
1050
|
+
|
|
1051
|
+
**A photo essay: figures in the text, one gallery**
|
|
1052
|
+
|
|
1053
|
+
```vue
|
|
1054
|
+
<template>
|
|
1055
|
+
<article class="essay">
|
|
1056
|
+
<header class="essay__head">
|
|
1057
|
+
<h2 class="essay__title">Route 1, in winter light</h2>
|
|
1058
|
+
<p class="essay__dek">
|
|
1059
|
+
Nine days on the ring road between November storms, with the sun up for
|
|
1060
|
+
five hours a day and never more than a hand above the hills.
|
|
1061
|
+
</p>
|
|
1062
|
+
</header>
|
|
1063
|
+
|
|
1064
|
+
<div class="essay__body">
|
|
1065
|
+
<p>
|
|
1066
|
+
The rental desk asked twice whether we were sure. In winter the road is
|
|
1067
|
+
open more days than it is closed, they said, but nobody can tell you
|
|
1068
|
+
which ones; you check the map in the morning, and again at lunch.
|
|
1069
|
+
</p>
|
|
1070
|
+
|
|
1071
|
+
<figure class="essay__fig essay__fig--wide">
|
|
1072
|
+
<button
|
|
1073
|
+
v-bb-gallery="{ id: 'route1', item: shot(0).src }"
|
|
1074
|
+
class="essay__open"
|
|
1075
|
+
type="button"
|
|
1076
|
+
>
|
|
1077
|
+
<img
|
|
1078
|
+
:alt="shot(0).alt"
|
|
1079
|
+
sizes="(min-width: 1100px) 1040px, 100vw"
|
|
1080
|
+
:src="shot(0).thumb"
|
|
1081
|
+
:srcset="shot(0).srcset"
|
|
1082
|
+
/>
|
|
1083
|
+
</button>
|
|
1084
|
+
<figcaption>
|
|
1085
|
+
{{ shot(0).caption }} <span>{{ shot(0).credit }}</span>
|
|
1086
|
+
</figcaption>
|
|
1087
|
+
</figure>
|
|
1088
|
+
|
|
1089
|
+
<p>
|
|
1090
|
+
South of the passes the coast is black. Black sand, black stacks of
|
|
1091
|
+
basalt, and between them a surf that comes up the beach in long white
|
|
1092
|
+
sheets, further than you think it will. We kept to the dunes and walked
|
|
1093
|
+
out to the wreck instead.
|
|
1094
|
+
</p>
|
|
1095
|
+
|
|
1096
|
+
<div class="essay__pair">
|
|
1097
|
+
<figure v-for="i in [1, 2]" :key="i" class="essay__fig">
|
|
1098
|
+
<button
|
|
1099
|
+
v-bb-gallery="{ id: 'route1', item: shot(i).src }"
|
|
1100
|
+
class="essay__open"
|
|
1101
|
+
type="button"
|
|
1102
|
+
>
|
|
1103
|
+
<img :alt="shot(i).alt" :src="shot(i).thumb" />
|
|
1104
|
+
</button>
|
|
1105
|
+
<figcaption>
|
|
1106
|
+
{{ shot(i).caption }} <span>{{ shot(i).credit }}</span>
|
|
1107
|
+
</figcaption>
|
|
1108
|
+
</figure>
|
|
1109
|
+
</div>
|
|
1110
|
+
|
|
1111
|
+
<p>
|
|
1112
|
+
Water is the other thing. It falls off every cliff, steams out of the
|
|
1113
|
+
ground, and sits in the lagoon at the temperature of a bath while the
|
|
1114
|
+
air above it freezes your hair.
|
|
1115
|
+
</p>
|
|
1116
|
+
|
|
1117
|
+
<div class="essay__strip">
|
|
1118
|
+
<button
|
|
1119
|
+
v-for="i in [3, 4, 5, 6, 7]"
|
|
1120
|
+
:key="i"
|
|
1121
|
+
v-bb-gallery="{ id: 'route1', item: i }"
|
|
1122
|
+
:aria-label="shot(i).alt"
|
|
1123
|
+
class="essay__open essay__open--strip"
|
|
1124
|
+
type="button"
|
|
1125
|
+
>
|
|
1126
|
+
<img alt="" :src="shot(i).thumb" />
|
|
1127
|
+
</button>
|
|
1128
|
+
</div>
|
|
1129
|
+
<p class="essay__note">
|
|
1130
|
+
Five more from the east and north. Select any to see them full screen,
|
|
1131
|
+
with their captions.
|
|
1132
|
+
</p>
|
|
1133
|
+
|
|
1134
|
+
<figure class="essay__fig essay__fig--bleed">
|
|
1135
|
+
<button
|
|
1136
|
+
v-bb-gallery="{ id: 'route1', item: 8 }"
|
|
1137
|
+
class="essay__open"
|
|
1138
|
+
type="button"
|
|
1139
|
+
>
|
|
1140
|
+
<img
|
|
1141
|
+
:alt="shot(8).alt"
|
|
1142
|
+
sizes="100vw"
|
|
1143
|
+
:src="shot(8).thumb"
|
|
1144
|
+
:srcset="shot(8).srcset"
|
|
1145
|
+
/>
|
|
1146
|
+
</button>
|
|
1147
|
+
<figcaption>
|
|
1148
|
+
{{ shot(8).caption }} <span>{{ shot(8).credit }}</span>
|
|
1149
|
+
</figcaption>
|
|
1150
|
+
</figure>
|
|
1151
|
+
</div>
|
|
1152
|
+
|
|
1153
|
+
<BbGallery
|
|
1154
|
+
id="route1"
|
|
1155
|
+
:items="essay"
|
|
1156
|
+
pt:caption="essay__vcap"
|
|
1157
|
+
pt:root="essay__viewer"
|
|
1158
|
+
title="Route 1, in winter light"
|
|
1159
|
+
>
|
|
1160
|
+
<template #footer="{ item, index, count }">
|
|
1161
|
+
<p class="essay__vfoot">
|
|
1162
|
+
<span>Photograph: {{ item.credit }}</span>
|
|
1163
|
+
<span>{{ index + 1 }} of {{ count }}</span>
|
|
1164
|
+
</p>
|
|
1165
|
+
</template>
|
|
1166
|
+
</BbGallery>
|
|
1167
|
+
</article>
|
|
1168
|
+
</template>
|
|
1169
|
+
|
|
1170
|
+
<script setup lang="ts">
|
|
1171
|
+
import { BbGallery, vBbGallery } from 'bitboss-ui';
|
|
1172
|
+
|
|
1173
|
+
// Real photographs from picsum.photos (Unsplash licence). Each gets a srcset at
|
|
1174
|
+
// its own ratio and its intrinsic size, which is all BbGallery needs to
|
|
1175
|
+
// reserve the box and pick the right file; `thumb` is for the page's figures.
|
|
1176
|
+
const picsum = (id: number, w: number, h: number) => {
|
|
1177
|
+
const at = (x: number) =>
|
|
1178
|
+
`https://picsum.photos/id/${id}/${x}/${Math.round((x * h) / w)}`;
|
|
1179
|
+
const width = Math.min(2400, w);
|
|
1180
|
+
return {
|
|
1181
|
+
src: at(Math.min(1600, w)),
|
|
1182
|
+
srcset: [800, 1600, 2400]
|
|
1183
|
+
.filter((x) => x <= w)
|
|
1184
|
+
.map((x) => `${at(x)} ${x}w`)
|
|
1185
|
+
.join(', '),
|
|
1186
|
+
width,
|
|
1187
|
+
height: Math.round((width * h) / w),
|
|
1188
|
+
thumb: at(640),
|
|
1189
|
+
};
|
|
1190
|
+
};
|
|
1191
|
+
|
|
1192
|
+
type Shot = ReturnType<typeof picsum> & {
|
|
1193
|
+
alt: string;
|
|
1194
|
+
caption?: string;
|
|
1195
|
+
credit: string;
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1198
|
+
const essay: Shot[] = [
|
|
1199
|
+
{
|
|
1200
|
+
...picsum(563, 3872, 2592),
|
|
1201
|
+
alt: 'An empty two-lane road running straight toward a range of dark mountains',
|
|
1202
|
+
caption:
|
|
1203
|
+
'The road out of town is two lanes and a yellow line, and for the first hour it is the only made thing in the landscape.',
|
|
1204
|
+
credit: 'Bec Brown',
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
...picsum(515, 4585, 3439),
|
|
1208
|
+
alt: 'The fuselage of a crashed plane on a black sand beach under a grey sky',
|
|
1209
|
+
caption:
|
|
1210
|
+
'The wreck at Sólheimasandur has lain on the black sand since 1973. In winter you walk the forty minutes out with the wind at your back, and back into it.',
|
|
1211
|
+
credit: 'Jeff Sheldon',
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
...picsum(1052, 4000, 2667),
|
|
1215
|
+
alt: 'Dark basalt sea stacks rising from the surf off a black beach',
|
|
1216
|
+
caption:
|
|
1217
|
+
'Sea stacks off the south coast. Locals keep a long way back from the waterline: the waves here come further up the sand than they seem to.',
|
|
1218
|
+
credit: 'Annie Spratt',
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
...picsum(1035, 5000, 3334),
|
|
1222
|
+
alt: 'A person with arms raised at the foot of a tall waterfall, a rainbow in its spray',
|
|
1223
|
+
caption: 'Spray, rainbow, and a stranger who asked us to take this.',
|
|
1224
|
+
credit: 'Jared Erondu',
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1227
|
+
...picsum(509, 4608, 3456),
|
|
1228
|
+
alt: 'A waterfall falling from a mossy cliff into a pool',
|
|
1229
|
+
credit: 'Jeff Sheldon',
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
...picsum(510, 4326, 3245),
|
|
1233
|
+
alt: 'A small white church with a red roof on a flat plain, hills behind',
|
|
1234
|
+
caption:
|
|
1235
|
+
'Every farm seemed to have its own church, and none of them was locked.',
|
|
1236
|
+
credit: 'Jeff Sheldon',
|
|
1237
|
+
},
|
|
1238
|
+
{
|
|
1239
|
+
...picsum(512, 3434, 4340),
|
|
1240
|
+
alt: 'Bathers in milky blue geothermal water, steam rising around them',
|
|
1241
|
+
caption:
|
|
1242
|
+
'The lagoon at dusk: minus six in the air, thirty-eight in the water.',
|
|
1243
|
+
credit: 'Jeff Sheldon',
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
...picsum(964, 5000, 3490),
|
|
1247
|
+
alt: 'A snow-covered road curving away across a white, empty plain',
|
|
1248
|
+
caption:
|
|
1249
|
+
'North of the passes the road and the land are the same colour. The poles along the verge are how you stay on it.',
|
|
1250
|
+
credit: 'Jon Ottosson',
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
...picsum(1022, 5000, 2813),
|
|
1254
|
+
alt: 'Green aurora above a dark line of trees under a starry sky',
|
|
1255
|
+
caption:
|
|
1256
|
+
'Second night, 2 a.m. We had given up and were walking back to the car.',
|
|
1257
|
+
credit: 'Vashishtha Jogi',
|
|
1258
|
+
},
|
|
1259
|
+
];
|
|
1260
|
+
|
|
1261
|
+
const shot = (i: number) => essay[i];
|
|
1262
|
+
</script>
|
|
1263
|
+
|
|
1264
|
+
<style scoped>
|
|
1265
|
+
.essay {
|
|
1266
|
+
--ink: #1d1a17;
|
|
1267
|
+
--paper: #f5f1ea;
|
|
1268
|
+
--muted: #5f574e;
|
|
1269
|
+
--rust: #9a3b1b;
|
|
1270
|
+
background: var(--paper);
|
|
1271
|
+
color: var(--ink);
|
|
1272
|
+
font-family: 'Newsreader', serif;
|
|
1273
|
+
font-optical-sizing: auto;
|
|
1274
|
+
padding: clamp(40px, 8vw, 112px) clamp(16px, 5vw, 64px) 96px;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
.essay__head {
|
|
1278
|
+
margin: 0 auto 56px;
|
|
1279
|
+
max-width: 760px;
|
|
1280
|
+
text-align: center;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
.essay__title {
|
|
1284
|
+
font-size: clamp(2.75rem, 7vw, 5.5rem);
|
|
1285
|
+
font-style: italic;
|
|
1286
|
+
font-weight: 400;
|
|
1287
|
+
letter-spacing: -0.03em;
|
|
1288
|
+
line-height: 0.95;
|
|
1289
|
+
margin: 0;
|
|
1290
|
+
text-wrap: balance;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
.essay__dek {
|
|
1294
|
+
color: var(--muted);
|
|
1295
|
+
font-size: clamp(1.15rem, 2vw, 1.4rem);
|
|
1296
|
+
line-height: 1.45;
|
|
1297
|
+
margin: 24px auto 0;
|
|
1298
|
+
max-width: 52ch;
|
|
1299
|
+
text-wrap: pretty;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
.essay__body {
|
|
1303
|
+
display: grid;
|
|
1304
|
+
gap: 40px;
|
|
1305
|
+
justify-items: center;
|
|
1306
|
+
|
|
1307
|
+
> p {
|
|
1308
|
+
font-size: 1.1875rem;
|
|
1309
|
+
line-height: 1.65;
|
|
1310
|
+
margin: 0;
|
|
1311
|
+
max-width: 66ch;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
.essay__body > p:first-child::first-letter {
|
|
1316
|
+
float: inline-start;
|
|
1317
|
+
font-size: 4.2em;
|
|
1318
|
+
line-height: 0.82;
|
|
1319
|
+
margin-block-start: 6px;
|
|
1320
|
+
margin-inline-end: 10px;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
.essay__fig {
|
|
1324
|
+
margin: 0;
|
|
1325
|
+
width: 100%;
|
|
1326
|
+
|
|
1327
|
+
figcaption {
|
|
1328
|
+
color: var(--muted);
|
|
1329
|
+
font-size: 0.9375rem;
|
|
1330
|
+
line-height: 1.5;
|
|
1331
|
+
margin-top: 12px;
|
|
1332
|
+
max-width: 62ch;
|
|
1333
|
+
|
|
1334
|
+
span {
|
|
1335
|
+
font-size: 0.8125rem;
|
|
1336
|
+
font-variant: small-caps;
|
|
1337
|
+
letter-spacing: 0.04em;
|
|
1338
|
+
margin-inline-start: 4px;
|
|
1339
|
+
white-space: nowrap;
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
.essay__fig--wide {
|
|
1345
|
+
max-width: 1040px;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
.essay__fig--bleed {
|
|
1349
|
+
margin-inline: calc(-1 * clamp(16px, 5vw, 64px));
|
|
1350
|
+
width: calc(100% + 2 * clamp(16px, 5vw, 64px));
|
|
1351
|
+
|
|
1352
|
+
figcaption {
|
|
1353
|
+
margin-inline: auto;
|
|
1354
|
+
padding-inline: 16px;
|
|
1355
|
+
text-align: center;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
img {
|
|
1359
|
+
aspect-ratio: 16 / 7;
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
.essay__open {
|
|
1364
|
+
background: #e3ddd2;
|
|
1365
|
+
border: 0;
|
|
1366
|
+
cursor: zoom-in;
|
|
1367
|
+
display: block;
|
|
1368
|
+
overflow: hidden;
|
|
1369
|
+
padding: 0;
|
|
1370
|
+
width: 100%;
|
|
1371
|
+
|
|
1372
|
+
img {
|
|
1373
|
+
display: block;
|
|
1374
|
+
height: 100%;
|
|
1375
|
+
object-fit: cover;
|
|
1376
|
+
transition: filter 400ms ease-out;
|
|
1377
|
+
width: 100%;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
&:hover img {
|
|
1381
|
+
filter: brightness(1.06) saturate(1.05);
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
&:focus-visible {
|
|
1385
|
+
outline: 2px solid var(--rust);
|
|
1386
|
+
outline-offset: 4px;
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
.essay__pair {
|
|
1391
|
+
display: grid;
|
|
1392
|
+
gap: 24px;
|
|
1393
|
+
grid-template-columns: 1fr 1fr;
|
|
1394
|
+
max-width: 1040px;
|
|
1395
|
+
width: 100%;
|
|
1396
|
+
|
|
1397
|
+
img {
|
|
1398
|
+
aspect-ratio: 4 / 5;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
@media (max-width: 640px) {
|
|
1402
|
+
grid-template-columns: 1fr;
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
.essay__strip {
|
|
1407
|
+
display: grid;
|
|
1408
|
+
gap: 6px;
|
|
1409
|
+
grid-template-columns: repeat(5, 1fr);
|
|
1410
|
+
max-width: 1040px;
|
|
1411
|
+
width: 100%;
|
|
1412
|
+
|
|
1413
|
+
img {
|
|
1414
|
+
aspect-ratio: 3 / 4;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
@media (max-width: 640px) {
|
|
1418
|
+
grid-template-columns: repeat(3, 1fr);
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
.essay__body > .essay__note {
|
|
1423
|
+
color: var(--muted);
|
|
1424
|
+
font-size: 0.9375rem;
|
|
1425
|
+
font-style: italic;
|
|
1426
|
+
margin-top: -28px;
|
|
1427
|
+
}
|
|
1428
|
+
</style>
|
|
1429
|
+
|
|
1430
|
+
<!-- The viewer is in the top layer, outside this component's scope: its
|
|
1431
|
+
restyle is global, keyed on the pt classes. -->
|
|
1432
|
+
<style>
|
|
1433
|
+
/* Self-host the face named below (@font-face) in your app; until then it falls back to the system stack. */
|
|
1434
|
+
|
|
1435
|
+
.essay__viewer {
|
|
1436
|
+
--viewer-bg: #15120f;
|
|
1437
|
+
--viewer-fg: #f2ece2;
|
|
1438
|
+
font-family: 'Newsreader', serif;
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
.essay__viewer .bb-gallery__title {
|
|
1442
|
+
font-size: 1.125rem;
|
|
1443
|
+
font-style: italic;
|
|
1444
|
+
font-weight: 400;
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
/* Type only: the bar sets the caption's place and measure. This size and
|
|
1448
|
+
line-height keep the row one line tall, like a photo with no caption. */
|
|
1449
|
+
.essay__vcap {
|
|
1450
|
+
font-size: 1rem;
|
|
1451
|
+
line-height: 1.4;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
.essay__vfoot {
|
|
1455
|
+
color: rgb(242 236 226 / 0.78);
|
|
1456
|
+
display: flex;
|
|
1457
|
+
font-size: 0.875rem;
|
|
1458
|
+
font-variant: small-caps;
|
|
1459
|
+
font-variant-numeric: tabular-nums;
|
|
1460
|
+
justify-content: space-between;
|
|
1461
|
+
letter-spacing: 0.04em;
|
|
1462
|
+
margin: 0 auto;
|
|
1463
|
+
width: min(100%, 56ch);
|
|
1464
|
+
}
|
|
1465
|
+
</style>
|
|
1466
|
+
```
|
|
1467
|
+
|
|
1468
|
+
A portfolio: a justified grid where every frame keeps its own shape, a
|
|
1469
|
+
looping viewer with a `#header` of its own (title, plate number, a Close
|
|
1470
|
+
button) and the place and year in the footer.
|
|
1471
|
+
|
|
1472
|
+
**A portfolio: justified grid, own header, loop**
|
|
1473
|
+
|
|
1474
|
+
```vue
|
|
1475
|
+
<template>
|
|
1476
|
+
<section class="vert">
|
|
1477
|
+
<header class="vert__head">
|
|
1478
|
+
<h2 class="vert__title">Vertical</h2>
|
|
1479
|
+
<p class="vert__dek">
|
|
1480
|
+
Sixteen photographs of buildings, taken looking straight up. An edition
|
|
1481
|
+
in rows: every frame at its own shape.
|
|
1482
|
+
</p>
|
|
1483
|
+
</header>
|
|
1484
|
+
|
|
1485
|
+
<!-- A justified grid: each tile grows by its aspect ratio, so a row of
|
|
1486
|
+
mixed shapes fills the width at one height. -->
|
|
1487
|
+
<ol class="vert__grid">
|
|
1488
|
+
<li
|
|
1489
|
+
v-for="(p, i) in vertical"
|
|
1490
|
+
:key="p.src"
|
|
1491
|
+
:style="{ '--ar': p.width / p.height }"
|
|
1492
|
+
>
|
|
1493
|
+
<button
|
|
1494
|
+
v-bb-gallery="{ id: 'vertical', item: i }"
|
|
1495
|
+
class="vert__tile"
|
|
1496
|
+
type="button"
|
|
1497
|
+
>
|
|
1498
|
+
<img :alt="p.alt" decoding="async" loading="lazy" :src="p.thumb" />
|
|
1499
|
+
<span aria-hidden="true" class="vert__num">{{ plateNo(i) }}</span>
|
|
1500
|
+
</button>
|
|
1501
|
+
</li>
|
|
1502
|
+
</ol>
|
|
1503
|
+
|
|
1504
|
+
<BbGallery
|
|
1505
|
+
id="vertical"
|
|
1506
|
+
:items="vertical"
|
|
1507
|
+
loop
|
|
1508
|
+
pt:caption="hidden"
|
|
1509
|
+
pt:root="vert__viewer"
|
|
1510
|
+
>
|
|
1511
|
+
<template #header="{ index, count, close, titleId }">
|
|
1512
|
+
<div class="vert__bar">
|
|
1513
|
+
<h3 :id="titleId" class="vert__vtitle">Vertical</h3>
|
|
1514
|
+
<span class="vert__plate">
|
|
1515
|
+
{{ plateNo(index) }} <span>/ {{ plateNo(count - 1) }}</span>
|
|
1516
|
+
</span>
|
|
1517
|
+
<button class="vert__close" type="button" @click="close">
|
|
1518
|
+
Close
|
|
1519
|
+
<kbd>Esc</kbd>
|
|
1520
|
+
</button>
|
|
1521
|
+
</div>
|
|
1522
|
+
</template>
|
|
1523
|
+
<template #footer="{ index }">
|
|
1524
|
+
<p class="vert__meta">
|
|
1525
|
+
<span class="vert__place">{{ vertical[index].place }}</span>
|
|
1526
|
+
<span>{{ vertical[index].year }} · {{ vertical[index].credit }}</span>
|
|
1527
|
+
</p>
|
|
1528
|
+
</template>
|
|
1529
|
+
</BbGallery>
|
|
1530
|
+
</section>
|
|
1531
|
+
</template>
|
|
1532
|
+
|
|
1533
|
+
<script setup lang="ts">
|
|
1534
|
+
import { BbGallery, vBbGallery } from 'bitboss-ui';
|
|
1535
|
+
|
|
1536
|
+
// Real photographs from picsum.photos (Unsplash licence). Each gets a srcset at
|
|
1537
|
+
// its own ratio and its intrinsic size, which is all BbGallery needs to
|
|
1538
|
+
// reserve the box and pick the right file; `thumb` is for the grid.
|
|
1539
|
+
const picsum = (id: number, w: number, h: number) => {
|
|
1540
|
+
const at = (x: number) =>
|
|
1541
|
+
`https://picsum.photos/id/${id}/${x}/${Math.round((x * h) / w)}`;
|
|
1542
|
+
const width = Math.min(2400, w);
|
|
1543
|
+
return {
|
|
1544
|
+
src: at(Math.min(1600, w)),
|
|
1545
|
+
srcset: [800, 1600, 2400]
|
|
1546
|
+
.filter((x) => x <= w)
|
|
1547
|
+
.map((x) => `${at(x)} ${x}w`)
|
|
1548
|
+
.join(', '),
|
|
1549
|
+
width,
|
|
1550
|
+
height: Math.round((width * h) / w),
|
|
1551
|
+
thumb: at(640),
|
|
1552
|
+
};
|
|
1553
|
+
};
|
|
1554
|
+
|
|
1555
|
+
/** A plate of the edition: the photo, where it was taken, when, by whom. */
|
|
1556
|
+
const plate = (
|
|
1557
|
+
id: number,
|
|
1558
|
+
w: number,
|
|
1559
|
+
h: number,
|
|
1560
|
+
alt: string,
|
|
1561
|
+
place: string,
|
|
1562
|
+
year: number,
|
|
1563
|
+
credit: string
|
|
1564
|
+
) => ({ ...picsum(id, w, h), alt, place, year, credit });
|
|
1565
|
+
|
|
1566
|
+
const vertical = [
|
|
1567
|
+
plate(
|
|
1568
|
+
1031,
|
|
1569
|
+
5000,
|
|
1570
|
+
2812,
|
|
1571
|
+
'Two glass towers seen from directly below, converging against a pale sky',
|
|
1572
|
+
'Converging towers',
|
|
1573
|
+
2019,
|
|
1574
|
+
'Mike Wilson'
|
|
1575
|
+
),
|
|
1576
|
+
plate(
|
|
1577
|
+
948,
|
|
1578
|
+
1942,
|
|
1579
|
+
2913,
|
|
1580
|
+
'A tower of identical windows rising into a blue sky',
|
|
1581
|
+
'Grid, rising',
|
|
1582
|
+
2020,
|
|
1583
|
+
'Mihail Ribkin'
|
|
1584
|
+
),
|
|
1585
|
+
plate(
|
|
1586
|
+
953,
|
|
1587
|
+
4752,
|
|
1588
|
+
3168,
|
|
1589
|
+
'An orange courtyard seen from below, balconies circling an open sky',
|
|
1590
|
+
'Courtyard, orange hour',
|
|
1591
|
+
2018,
|
|
1592
|
+
'Alexandre Perotto'
|
|
1593
|
+
),
|
|
1594
|
+
plate(
|
|
1595
|
+
893,
|
|
1596
|
+
4342,
|
|
1597
|
+
2895,
|
|
1598
|
+
'A white facade folded into soft waves of light and shadow',
|
|
1599
|
+
'Folded facade',
|
|
1600
|
+
2021,
|
|
1601
|
+
'Samuel Zeller'
|
|
1602
|
+
),
|
|
1603
|
+
plate(
|
|
1604
|
+
736,
|
|
1605
|
+
3333,
|
|
1606
|
+
5000,
|
|
1607
|
+
'A stepped art deco tower in warm evening light',
|
|
1608
|
+
'Deco spire',
|
|
1609
|
+
2017,
|
|
1610
|
+
'Ben Dumond'
|
|
1611
|
+
),
|
|
1612
|
+
plate(
|
|
1613
|
+
952,
|
|
1614
|
+
4130,
|
|
1615
|
+
2908,
|
|
1616
|
+
'A black and white courtyard seen from below, arched windows ringing the sky',
|
|
1617
|
+
'Well of light',
|
|
1618
|
+
2019,
|
|
1619
|
+
'Noah Rosenfield'
|
|
1620
|
+
),
|
|
1621
|
+
plate(
|
|
1622
|
+
954,
|
|
1623
|
+
5000,
|
|
1624
|
+
3280,
|
|
1625
|
+
'A white staircase rising along a bare white wall',
|
|
1626
|
+
'Stair, white on white',
|
|
1627
|
+
2022,
|
|
1628
|
+
'Todd Quackenbush'
|
|
1629
|
+
),
|
|
1630
|
+
plate(
|
|
1631
|
+
508,
|
|
1632
|
+
2955,
|
|
1633
|
+
3892,
|
|
1634
|
+
'Tall white pointed arches along a church nave',
|
|
1635
|
+
'Nave',
|
|
1636
|
+
2016,
|
|
1637
|
+
'Jeff Sheldon'
|
|
1638
|
+
),
|
|
1639
|
+
plate(
|
|
1640
|
+
1076,
|
|
1641
|
+
4835,
|
|
1642
|
+
3223,
|
|
1643
|
+
'A brown tower of stacked balconies seen from below, its corner like a prow',
|
|
1644
|
+
'Prow',
|
|
1645
|
+
2021,
|
|
1646
|
+
'Samuel Zeller'
|
|
1647
|
+
),
|
|
1648
|
+
plate(
|
|
1649
|
+
939,
|
|
1650
|
+
5000,
|
|
1651
|
+
3333,
|
|
1652
|
+
'A narrow wedge-shaped building in black and white',
|
|
1653
|
+
'The wedge',
|
|
1654
|
+
2015,
|
|
1655
|
+
'Alec Cutter'
|
|
1656
|
+
),
|
|
1657
|
+
plate(
|
|
1658
|
+
887,
|
|
1659
|
+
5000,
|
|
1660
|
+
3334,
|
|
1661
|
+
'Rows of identical white windows filling the frame',
|
|
1662
|
+
'Repeat',
|
|
1663
|
+
2020,
|
|
1664
|
+
'Roman Kraft'
|
|
1665
|
+
),
|
|
1666
|
+
plate(
|
|
1667
|
+
618,
|
|
1668
|
+
2509,
|
|
1669
|
+
1673,
|
|
1670
|
+
'A glass roof grid curving overhead in a white hall',
|
|
1671
|
+
'Canopy',
|
|
1672
|
+
2018,
|
|
1673
|
+
'Mika Ruusunen'
|
|
1674
|
+
),
|
|
1675
|
+
plate(
|
|
1676
|
+
949,
|
|
1677
|
+
3324,
|
|
1678
|
+
5000,
|
|
1679
|
+
'A spiral of white balconies seen from below, a skylight at its centre',
|
|
1680
|
+
'Spiral',
|
|
1681
|
+
2022,
|
|
1682
|
+
'Drew Patrick Miller'
|
|
1683
|
+
),
|
|
1684
|
+
plate(
|
|
1685
|
+
677,
|
|
1686
|
+
4288,
|
|
1687
|
+
2848,
|
|
1688
|
+
'Four towers seen from below meeting in a cross of sky',
|
|
1689
|
+
'Cross of sky',
|
|
1690
|
+
2017,
|
|
1691
|
+
'davide ragusa'
|
|
1692
|
+
),
|
|
1693
|
+
plate(
|
|
1694
|
+
942,
|
|
1695
|
+
5000,
|
|
1696
|
+
3333,
|
|
1697
|
+
'White concrete blades cutting into a black sky',
|
|
1698
|
+
'Blades',
|
|
1699
|
+
2023,
|
|
1700
|
+
'Carl Nenzen Loven'
|
|
1701
|
+
),
|
|
1702
|
+
plate(
|
|
1703
|
+
1075,
|
|
1704
|
+
4858,
|
|
1705
|
+
3239,
|
|
1706
|
+
'A slim tower framed between two dark buildings',
|
|
1707
|
+
'Needle',
|
|
1708
|
+
2016,
|
|
1709
|
+
'Verne Ho'
|
|
1710
|
+
),
|
|
1711
|
+
];
|
|
1712
|
+
|
|
1713
|
+
const plateNo = (i: number) => String(i + 1).padStart(2, '0');
|
|
1714
|
+
</script>
|
|
1715
|
+
|
|
1716
|
+
<style scoped>
|
|
1717
|
+
.vert {
|
|
1718
|
+
--ink: #ecebe6;
|
|
1719
|
+
--night: #0c0c0d;
|
|
1720
|
+
--dim: #9a9890;
|
|
1721
|
+
background: var(--night);
|
|
1722
|
+
color: var(--ink);
|
|
1723
|
+
font-family: 'Archivo', sans-serif;
|
|
1724
|
+
padding: clamp(32px, 6vw, 88px) clamp(12px, 3vw, 40px) 88px;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
.vert__head {
|
|
1728
|
+
align-items: end;
|
|
1729
|
+
display: grid;
|
|
1730
|
+
gap: 16px 48px;
|
|
1731
|
+
grid-template-columns: auto minmax(0, 36ch);
|
|
1732
|
+
justify-content: space-between;
|
|
1733
|
+
margin-bottom: clamp(32px, 5vw, 64px);
|
|
1734
|
+
|
|
1735
|
+
@media (max-width: 720px) {
|
|
1736
|
+
grid-template-columns: 1fr;
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
.vert__title {
|
|
1741
|
+
font-size: clamp(3.5rem, 13vw, 10.5rem);
|
|
1742
|
+
font-stretch: 125%;
|
|
1743
|
+
font-weight: 800;
|
|
1744
|
+
letter-spacing: -0.04em;
|
|
1745
|
+
line-height: 0.8;
|
|
1746
|
+
margin: 0;
|
|
1747
|
+
text-transform: uppercase;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
.vert__dek {
|
|
1751
|
+
color: var(--dim);
|
|
1752
|
+
font-size: 1rem;
|
|
1753
|
+
line-height: 1.55;
|
|
1754
|
+
margin: 0;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
.vert__grid {
|
|
1758
|
+
display: flex;
|
|
1759
|
+
flex-wrap: wrap;
|
|
1760
|
+
gap: 6px;
|
|
1761
|
+
list-style: none;
|
|
1762
|
+
margin: 0;
|
|
1763
|
+
padding: 0;
|
|
1764
|
+
|
|
1765
|
+
li {
|
|
1766
|
+
flex: var(--ar) 1 calc(var(--ar) * clamp(150px, 22vw, 260px));
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
/* The last row keeps its height instead of stretching two frames wide. */
|
|
1770
|
+
&::after {
|
|
1771
|
+
content: '';
|
|
1772
|
+
flex: 10 1 0;
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
.vert__tile {
|
|
1777
|
+
aspect-ratio: var(--ar);
|
|
1778
|
+
background: #1a1a1c;
|
|
1779
|
+
border: 0;
|
|
1780
|
+
cursor: zoom-in;
|
|
1781
|
+
display: block;
|
|
1782
|
+
overflow: hidden;
|
|
1783
|
+
padding: 0;
|
|
1784
|
+
position: relative;
|
|
1785
|
+
width: 100%;
|
|
1786
|
+
|
|
1787
|
+
img {
|
|
1788
|
+
display: block;
|
|
1789
|
+
filter: grayscale(0.35) brightness(0.9);
|
|
1790
|
+
height: 100%;
|
|
1791
|
+
object-fit: cover;
|
|
1792
|
+
transition:
|
|
1793
|
+
filter 500ms cubic-bezier(0.16, 1, 0.3, 1),
|
|
1794
|
+
transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
1795
|
+
width: 100%;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
&:hover img,
|
|
1799
|
+
&:focus-visible img {
|
|
1800
|
+
filter: none;
|
|
1801
|
+
transform: scale(1.02);
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
&:focus-visible {
|
|
1805
|
+
outline: 2px solid var(--ink);
|
|
1806
|
+
outline-offset: 3px;
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
.vert__num {
|
|
1811
|
+
bottom: 8px;
|
|
1812
|
+
color: var(--ink);
|
|
1813
|
+
font:
|
|
1814
|
+
500 0.75rem/1 'JetBrains Mono',
|
|
1815
|
+
monospace;
|
|
1816
|
+
inset-inline-start: 10px;
|
|
1817
|
+
opacity: 0;
|
|
1818
|
+
position: absolute;
|
|
1819
|
+
text-shadow: 0 1px 4px rgb(0 0 0 / 0.8);
|
|
1820
|
+
transition: opacity 300ms ease-out;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
.vert__tile:hover .vert__num,
|
|
1824
|
+
.vert__tile:focus-visible .vert__num {
|
|
1825
|
+
opacity: 1;
|
|
1826
|
+
}
|
|
1827
|
+
</style>
|
|
1828
|
+
|
|
1829
|
+
<!-- The viewer is in the top layer, outside this component's scope: its
|
|
1830
|
+
restyle is global, keyed on the pt classes. -->
|
|
1831
|
+
<style>
|
|
1832
|
+
/* Self-host the face named below (@font-face) in your app; until then it falls back to the system stack. */
|
|
1833
|
+
|
|
1834
|
+
.vert__viewer {
|
|
1835
|
+
--viewer-bg: #050505;
|
|
1836
|
+
--viewer-fg: #ecebe6;
|
|
1837
|
+
--viewer-muted: rgb(236 235 230 / 0.7);
|
|
1838
|
+
--nav-size: 52px;
|
|
1839
|
+
--plate: transparent;
|
|
1840
|
+
font-family: 'Archivo', sans-serif;
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
.vert__viewer .bb-gallery__nav {
|
|
1844
|
+
backdrop-filter: none;
|
|
1845
|
+
box-shadow: none;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
.vert__bar {
|
|
1849
|
+
align-items: baseline;
|
|
1850
|
+
display: grid;
|
|
1851
|
+
gap: 16px;
|
|
1852
|
+
grid-template-columns: 1fr auto 1fr;
|
|
1853
|
+
width: 100%;
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
.vert__vtitle {
|
|
1857
|
+
font-size: 1rem;
|
|
1858
|
+
font-stretch: 125%;
|
|
1859
|
+
font-weight: 800;
|
|
1860
|
+
letter-spacing: 0.02em;
|
|
1861
|
+
margin: 0;
|
|
1862
|
+
text-transform: uppercase;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
.vert__plate {
|
|
1866
|
+
font:
|
|
1867
|
+
500 0.875rem/1 'JetBrains Mono',
|
|
1868
|
+
monospace;
|
|
1869
|
+
|
|
1870
|
+
span {
|
|
1871
|
+
color: rgb(236 235 230 / 0.55);
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
.vert__close {
|
|
1876
|
+
align-items: center;
|
|
1877
|
+
background: none;
|
|
1878
|
+
border: 0;
|
|
1879
|
+
color: inherit;
|
|
1880
|
+
cursor: pointer;
|
|
1881
|
+
display: inline-flex;
|
|
1882
|
+
font:
|
|
1883
|
+
500 0.875rem/1 'Archivo',
|
|
1884
|
+
sans-serif;
|
|
1885
|
+
gap: 10px;
|
|
1886
|
+
justify-self: end;
|
|
1887
|
+
min-height: 44px;
|
|
1888
|
+
padding: 0;
|
|
1889
|
+
|
|
1890
|
+
kbd {
|
|
1891
|
+
border: 1px solid rgb(236 235 230 / 0.35);
|
|
1892
|
+
border-radius: 4px;
|
|
1893
|
+
font:
|
|
1894
|
+
500 0.6875rem/1 'JetBrains Mono',
|
|
1895
|
+
monospace;
|
|
1896
|
+
padding: 4px 6px;
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
&:hover {
|
|
1900
|
+
text-decoration: underline;
|
|
1901
|
+
text-underline-offset: 4px;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
&:focus-visible {
|
|
1905
|
+
outline: 2px solid currentColor;
|
|
1906
|
+
outline-offset: 4px;
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
.vert__meta {
|
|
1911
|
+
align-items: baseline;
|
|
1912
|
+
color: rgb(236 235 230 / 0.7);
|
|
1913
|
+
display: flex;
|
|
1914
|
+
font-size: 0.875rem;
|
|
1915
|
+
gap: 24px;
|
|
1916
|
+
justify-content: space-between;
|
|
1917
|
+
margin: 0;
|
|
1918
|
+
width: 100%;
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
.vert__place {
|
|
1922
|
+
color: #ecebe6;
|
|
1923
|
+
font-size: 1.125rem;
|
|
1924
|
+
font-stretch: 112%;
|
|
1925
|
+
font-weight: 600;
|
|
1926
|
+
}
|
|
1927
|
+
</style>
|
|
1928
|
+
```
|
|
1929
|
+
|
|
1930
|
+
### Accessibility
|
|
1931
|
+
|
|
1932
|
+
- The viewer is a modal dialog: focus starts on the stage (not on the close
|
|
1933
|
+
button), stays inside, and returns to the trigger, or to whatever had it
|
|
1934
|
+
for a `v-model` opening.
|
|
1935
|
+
- Stepping announces the position, the `alt` and the caption ("Image 3 of 12:
|
|
1936
|
+
Red rock walls at sunset"), once the steps stop, so fast keys never queue up
|
|
1937
|
+
a list.
|
|
1938
|
+
- Only the photo shown is in the accessibility tree; the others are hidden
|
|
1939
|
+
and inert.
|
|
1940
|
+
- An arrow that disables at an end hands focus to the other one, so the
|
|
1941
|
+
keys keep working.
|
|
1942
|
+
- The arrows and the close button are 44px, on a dark plate with a shadowed
|
|
1943
|
+
glyph that stays legible over any photo, and get a system border in forced
|
|
1944
|
+
colours.
|
|
1945
|
+
- Give every photo a real `alt`: it is what a screen reader hears, and what
|
|
1946
|
+
shows when the file fails.
|
|
1947
|
+
|
|
1948
|
+
## v-model
|
|
1949
|
+
|
|
1950
|
+
- `v-model` — type: `number \| null \| undefined`
|
|
1951
|
+
|
|
1952
|
+
## Props
|
|
1953
|
+
|
|
1954
|
+
| Prop | Type | Default | Required | Description |
|
|
1955
|
+
| --- | --- | --- | --- | --- |
|
|
1956
|
+
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `caption`, `close`, `counter`, `footer`, `header`, `image`, `more`, `next`, `prev`, `root`, `slide`, `title`. States: `zoomed`, `disabled`, `active`. What each one is: _Passthrough parts and states_ below. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. In `<script>` a `pt` value is typed `BbGalleryProps<Row>['pt']` (`BbGalleryProps<object>['pt']` for a preset that fits any row type, never `<any>`) (`PtValue` is not exported): § Typing `pt` in `<script>`. |
|
|
1957
|
+
| `closeOnBackdropClick` | `boolean \| undefined` | `false` | | A click (or a tap) on the dark area around the photo closes the viewer. Off, it does nothing there (a tap still hides the bars); Escape, the close button and a swipe down always close. |
|
|
1958
|
+
| `id` | `string \| undefined` | `undefined` | | The name `v-bb-gallery` opens it by, nearest to the trigger first. Also the viewer's DOM id. |
|
|
1959
|
+
| `items` | `readonly (string \| T)[]` | | yes | The photos, in order: `{ src, alt, caption, … }` entries or image URLs. |
|
|
1960
|
+
| `loop` | `boolean \| undefined` | `false` | | Previous on the first photo goes to the last, next on the last to the first (buttons, keys and a swipe). |
|
|
1961
|
+
| `modelValue` | `number \| null \| undefined` | `null` | | The photo in the viewer, `null` while it is closed. Bind it to open the viewer yourself; `v-bb-gallery` opens it without one. |
|
|
1962
|
+
| `title` | `string \| undefined` | `undefined` | | A title in the top bar, also the viewer's accessible name. Unset, the bar shows only the close button and the name is the locale's "Gallery". |
|
|
1963
|
+
|
|
1964
|
+
## Passthrough parts and states
|
|
1965
|
+
|
|
1966
|
+
`pt:<part>="…"` restyles a part; `pt:<part>:<state>="…"` applies only while the state is on. A component-wide state is on for every part at once; a _per node_ state resolves on each node of a broadcast part (one row, one option, one day). Grammar and merge rules: `guides/passthrough.md`. In `<script>`, type a `pt` value as `<Component>Props['pt']` (`<Component>Props<Row>['pt']` on a generic component); `PtValue` is not exported: `guides/passthrough.md` § Typing `pt` in `<script>`.
|
|
1967
|
+
|
|
1968
|
+
| Part | What it is |
|
|
1969
|
+
| --- | --- |
|
|
1970
|
+
| `root` | The full-screen viewer (a native modal `dialog`). |
|
|
1971
|
+
| `header` | The top bar. |
|
|
1972
|
+
| `title` | The title line in the bar. Not rendered when a `#header` slot replaces the bar. |
|
|
1973
|
+
| `close` | The close button. Not rendered when a `#header` slot replaces the bar. |
|
|
1974
|
+
| `slide` | Each slide (`figure`), per item (`active` on the one shown). |
|
|
1975
|
+
| `image` | Each photo. |
|
|
1976
|
+
| `caption` | The caption in the bottom bar: one line, or the full text running upward from it when opened. |
|
|
1977
|
+
| `prev` | The previous button (`disabled` on the first photo, never with `loop`). |
|
|
1978
|
+
| `next` | The next button (`disabled` on the last photo, never with `loop`). |
|
|
1979
|
+
| `footer` | The bottom bar. |
|
|
1980
|
+
| `counter` | The "3 / 12" in the bottom bar. Not rendered when a `#footer` slot replaces it. |
|
|
1981
|
+
| `more` | The button that reads a caption too long for its line in full ("More", and "Less" while it is open). Only there while the photo shown has such a caption. |
|
|
1982
|
+
|
|
1983
|
+
States are listed in precedence order: when two are on at once and their entries conflict, the later one wins.
|
|
1984
|
+
|
|
1985
|
+
| State | When it is on |
|
|
1986
|
+
| --- | --- |
|
|
1987
|
+
| `disabled` | Per node: `prev` on the first photo, `next` on the last. |
|
|
1988
|
+
| `active` | Per node: the slide shown. |
|
|
1989
|
+
| `zoomed` | Component-wide: the photo shown is zoomed in. |
|
|
1990
|
+
|
|
1991
|
+
## Events
|
|
1992
|
+
|
|
1993
|
+
- `update:modelValue` — `(value: number \| null): void` — Emitted with the new value whenever `v-model` changes.
|
|
1994
|
+
|
|
1995
|
+
## Slots
|
|
1996
|
+
|
|
1997
|
+
- `footer` — scope: `BbGallerySlotProps<T>` `{ index: number; count: number; item: T; go: (index: number) => void; close: () => void }` — Replaces the counter with a row of your own across the bottom bar: your own counter, actions, or a filmstrip that calls `go`. The caption keeps its own one-line row directly above yours (there whenever any photo has one), so the photo never jumps.
|
|
1998
|
+
- `header` — scope: `BbGalleryHeaderSlotProps<T>` `{ index: number; count: number; item: T; go: (index: number) => void; close: () => void; titleId: string; title: string }` — Replaces the whole top bar (title and close button), so it owns closing: wire your control to `close`, and `titleId` onto your title.
|
|
1999
|
+
- `title` — scope: `BbGalleryTitleSlotProps<T>` `{ index: number; count: number; item: T; go: (index: number) => void; close: () => void; text: string }` — Replaces the title text in the top bar; it still names the viewer.
|
|
2000
|
+
|
|
2001
|
+
## CSS custom properties
|
|
2002
|
+
|
|
2003
|
+
Set these on the element, or on a class you put on it, to retune this component alone — the sanctioned alternative to reaching past the API with `:deep()`. They are this component's own locals — a **Set on** of `pt:<part>` means the local lives on that part's element, so set it through that entry (`pt:box="[--border-color:var(--color-green-500)]"`); the global `--bb-*` theme tokens are a separate tier (see the [design-tokens guide](./guides/design-tokens.md), or the MCP `list_tokens` tool).
|
|
2004
|
+
|
|
2005
|
+
| Property | Default | What it is |
|
|
2006
|
+
| --- | --- | --- |
|
|
2007
|
+
| `--viewer-bg` | `rgb(12 12 12)` | The viewer's own: its plate and text, the bars' padding, the buttons. Every colour follows `--viewer-bg` / `--viewer-fg` (the muted text the ink, the arrows' plate the plate colour), so a light viewer is those two plus `color-scheme: light`; a derived local set directly wins. |
|
|
2008
|
+
| `--viewer-fg` | `rgb(244 244 242)` | |
|
|
2009
|
+
| `--viewer-muted` | `color-mix(in oklab, var(--viewer-fg) 75%, transparent)` | |
|
|
2010
|
+
| `--mark` | `var(--viewer-fg)` | A picker strip inside takes its current and focus marks from here. |
|
|
2011
|
+
| `--mark-bg` | `var(--viewer-bg)` | |
|
|
2012
|
+
| `--bar-px` | `max(16px, env(safe-area-inset-left), env(safe-area-inset-right))` | |
|
|
2013
|
+
| `--nav-size` | `44px` | |
|
|
2014
|
+
| `--plate` | `color-mix(in oklab, var(--viewer-bg) 60%, transparent)` | |
|
|
2015
|
+
| `--dismiss` | `0` | |
|
|
2016
|
+
| `--dismiss-y` | `0px` | |
|
|
2017
|
+
| `--d` | `var(--bb-transition-medium)` | |
|
|
2018
|
+
|
|
2019
|
+
## Component tree
|
|
2020
|
+
|
|
2021
|
+
`BbGallery` is not one component: rendering it mounts every component below, and each one is live inside it. **Read this before styling, theming or debugging `BbGallery`, and before concluding a part, a token or a behaviour does not exist** — it may live on a component further down. How to read it:
|
|
2022
|
+
|
|
2023
|
+
- **_internal_** nodes are building blocks with no API of their own: you reach them only through `BbGallery`. A pt part listed as landing there is set on `BbGallery` (`pt:<part>`).
|
|
2024
|
+
- **_public_** nodes are components with their own contract. `BbGallery` reaches one only through a pt part of its own that lands on it (shown on the parent node as `part → Component`, e.g. `spinner → BbSpinner`) or through a pt map it hands it (shown as "hands … the pt map", in `BbGallery`'s words → the child's). The child's other props and parts are not exposed; its contract explains what it renders.
|
|
2025
|
+
- **CSS custom properties** listed on a node are declared on THAT node's root and read by elements inside it. Set one on that node's root or on the element inside it that reads it — the pt part that lands there is how you reach it (`pt:box="[--border-color:…]"` on a text input) — never on `BbGallery`'s root, where the node's own declaration masks it (design-tokens guide, _Overriding one from a consumer app_, rule 0).
|
|
2026
|
+
- Listed nodes are the ones `BbGallery`'s API reaches or that declare a documented CSS variable; the rest fold into "also mounts". The complete tree, undocumented locals included, is `manifest/components/BbGallery.tree.json` (a public component in it is a name: its own tree file has the rest).
|
|
2027
|
+
|
|
2028
|
+
- `BbGallery` _(this component)_ — its own template binds: `header` → `div.bb-gallery__header`, `title` → `p.bb-gallery__title`, `close` → `CloseButton`, `slide` → `figure.bb-gallery__slide`, `image` → `img.bb-gallery__image`, `prev` → `button.bb-gallery__nav`, `next` → `button.bb-gallery__nav`, `footer` → `div.bb-gallery__footer`, `caption` → `p.bb-gallery__caption`, `more` → `button.bb-gallery__more`, `counter` → `p.bb-gallery__counter`
|
|
2029
|
+
- `CloseButton` _(internal — not importable, reach it through `BbGallery`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`; also mounts `BbIcon`
|
|
2030
|
+
- Also mounts `BbIcon`
|
|
2031
|
+
|
|
2032
|
+
## See Also
|
|
2033
|
+
|
|
2034
|
+
- [BbDialog](./BbDialog.md) — Presents modal dialogs; also the v-bb-dialog directive.
|