Files
ui/pkg/commerce/util/item-selector-options-accessor.ts
zeekayandHanzo Dev 57f9435929 Keep every package in one directory
The workspace declared pkg/* and pkgs/* both, so one repo had two names
for one concept and a package's home was a coin toss. The shared build
tooling already lived in pkg/ui/scripts and pkgs reached back into it
two levels up; now it is a sibling. hanzo.yml gates on pkg/ui, so the
published library stays where CI already looks and the rest joins it.

The publish glob follows: one root, one pattern, nothing invisible to it.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-08 23:50:28 -07:00

35 lines
1.2 KiB
TypeScript

import type { ItemSelectorOptions } from '../types'
export default (options: ItemSelectorOptions | undefined = {}): Required<ItemSelectorOptions> => {
const familyTitle = 'familyTitle' in options ? options.familyTitle! : 'short'
const showFamilyByline = 'showFamilyByline' in options ? options.showFamilyByline! : false
const showFamilyInOption = 'showFamilyInOption' in options ? options.showFamilyInOption! : false
const showByline = 'showByline' in options ? options.showByline! : true
const showPrice = 'showPrice' in options ? options.showPrice! : true
const showQuantity = 'showQuantity' in options ? options.showQuantity! : false
const buttonType = 'buttonType' in options ? options.buttonType! : 'text'
const horizButtons = 'horizButtons' in options ? options.horizButtons! : false
const showSlider = 'showSlider' in options ? options.showSlider! : true
const showButtonIfOnlyOne = 'showButtonIfOnlyOne' in options ? options.showButtonIfOnlyOne! : true
const sort = 'sort' in options ? options.sort! : 'none'
return {
showFamilyInOption,
familyTitle,
showFamilyByline,
showByline,
showPrice,
showQuantity,
buttonType,
horizButtons,
showSlider,
showButtonIfOnlyOne,
sort,
}
}