@vielzeug/refine 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion-item.cjs +1 -1
- package/dist/accordion-item.cjs.map +1 -1
- package/dist/accordion-item.js +1 -1
- package/dist/accordion-item.js.map +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.cjs.map +1 -1
- package/dist/card.js +1 -1
- package/dist/card.js.map +1 -1
- package/dist/chat-message.cjs +1 -1
- package/dist/chat-message.cjs.map +1 -1
- package/dist/chat-message.js +1 -1
- package/dist/chat-message.js.map +1 -1
- package/dist/combobox.cjs +9 -7
- package/dist/combobox.cjs.map +1 -1
- package/dist/combobox.js +55 -48
- package/dist/combobox.js.map +1 -1
- package/dist/content/index.d.ts +2 -0
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/list/list-item.css.cjs +1 -1
- package/dist/content/list/list-item.css.cjs.map +1 -1
- package/dist/content/list/list-item.css.js +1 -1
- package/dist/content/list/list-item.css.js.map +1 -1
- package/dist/content/list/list-item.d.ts +9 -0
- package/dist/content/list/list-item.d.ts.map +1 -1
- package/dist/content/stats/stats.css.cjs +2 -0
- package/dist/content/stats/stats.css.cjs.map +1 -0
- package/dist/content/stats/stats.css.js +6 -0
- package/dist/content/stats/stats.css.js.map +1 -0
- package/dist/content/stats/stats.d.ts +72 -0
- package/dist/content/stats/stats.d.ts.map +1 -0
- package/dist/core/auto-resize.cjs +1 -1
- package/dist/core/auto-resize.cjs.map +1 -1
- package/dist/core/auto-resize.js +1 -1
- package/dist/core/auto-resize.js.map +1 -1
- package/dist/custom-elements.json +5087 -4791
- package/dist/datagrid.cjs +199 -179
- package/dist/datagrid.cjs.map +1 -1
- package/dist/datagrid.js +435 -321
- package/dist/datagrid.js.map +1 -1
- package/dist/disclosure/tab-item/tab-item.css.cjs +1 -1
- package/dist/disclosure/tab-item/tab-item.css.cjs.map +1 -1
- package/dist/disclosure/tab-item/tab-item.css.js +1 -1
- package/dist/disclosure/tab-item/tab-item.css.js.map +1 -1
- package/dist/disclosure/tab-item/tab-item.d.ts +3 -0
- package/dist/disclosure/tab-item/tab-item.d.ts.map +1 -1
- package/dist/disclosure/tabs/tabs.css.cjs +1 -1
- package/dist/disclosure/tabs/tabs.css.cjs.map +1 -1
- package/dist/disclosure/tabs/tabs.css.js +1 -1
- package/dist/disclosure/tabs/tabs.css.js.map +1 -1
- package/dist/disclosure/tabs/tabs.d.ts +4 -0
- package/dist/disclosure/tabs/tabs.d.ts.map +1 -1
- package/dist/frameworks/elements.d.ts +2 -1
- package/dist/icon.cjs +1 -1
- package/dist/icon.cjs.map +1 -1
- package/dist/icon.js +1 -1
- package/dist/icon.js.map +1 -1
- package/dist/input.cjs +5 -4
- package/dist/input.cjs.map +1 -1
- package/dist/input.js +14 -8
- package/dist/input.js.map +1 -1
- package/dist/inputs/combobox/combobox-options.cjs +1 -1
- package/dist/inputs/combobox/combobox-options.cjs.map +1 -1
- package/dist/inputs/combobox/combobox-options.d.ts.map +1 -1
- package/dist/inputs/combobox/combobox-options.js +1 -0
- package/dist/inputs/combobox/combobox-options.js.map +1 -1
- package/dist/inputs/combobox/combobox.css.cjs +1 -1
- package/dist/inputs/combobox/combobox.css.cjs.map +1 -1
- package/dist/inputs/combobox/combobox.css.js +1 -1
- package/dist/inputs/combobox/combobox.css.js.map +1 -1
- package/dist/inputs/combobox/combobox.d.ts +1 -0
- package/dist/inputs/combobox/combobox.d.ts.map +1 -1
- package/dist/inputs/combobox/combobox.types.d.ts +7 -0
- package/dist/inputs/combobox/combobox.types.d.ts.map +1 -1
- package/dist/inputs/datagrid/datagrid-model.cjs +1 -1
- package/dist/inputs/datagrid/datagrid-model.cjs.map +1 -1
- package/dist/inputs/datagrid/datagrid-model.d.ts +17 -3
- package/dist/inputs/datagrid/datagrid-model.d.ts.map +1 -1
- package/dist/inputs/datagrid/datagrid-model.js +93 -70
- package/dist/inputs/datagrid/datagrid-model.js.map +1 -1
- package/dist/inputs/datagrid/datagrid.css.cjs +1 -1
- package/dist/inputs/datagrid/datagrid.css.cjs.map +1 -1
- package/dist/inputs/datagrid/datagrid.css.js +1 -1
- package/dist/inputs/datagrid/datagrid.css.js.map +1 -1
- package/dist/inputs/datagrid/datagrid.d.ts +54 -4
- package/dist/inputs/datagrid/datagrid.d.ts.map +1 -1
- package/dist/inputs/index.d.ts +1 -1
- package/dist/inputs/index.d.ts.map +1 -1
- package/dist/inputs/input/input.css.cjs +1 -1
- package/dist/inputs/input/input.css.cjs.map +1 -1
- package/dist/inputs/input/input.css.js +1 -1
- package/dist/inputs/input/input.css.js.map +1 -1
- package/dist/inputs/input/input.d.ts +3 -0
- package/dist/inputs/input/input.d.ts.map +1 -1
- package/dist/inputs/select/select.css.cjs +1 -1
- package/dist/inputs/select/select.css.cjs.map +1 -1
- package/dist/inputs/select/select.css.js +1 -1
- package/dist/inputs/select/select.css.js.map +1 -1
- package/dist/inputs/select/select.d.ts +5 -0
- package/dist/inputs/select/select.d.ts.map +1 -1
- package/dist/layout/navbar/navbar.d.ts +2 -0
- package/dist/layout/navbar/navbar.d.ts.map +1 -1
- package/dist/layout/sidebar/sidebar.css.cjs +1 -1
- package/dist/layout/sidebar/sidebar.css.cjs.map +1 -1
- package/dist/layout/sidebar/sidebar.css.js +1 -1
- package/dist/layout/sidebar/sidebar.css.js.map +1 -1
- package/dist/layout/sidebar/sidebar.d.ts +8 -0
- package/dist/layout/sidebar/sidebar.d.ts.map +1 -1
- package/dist/list-item.cjs +6 -5
- package/dist/list-item.cjs.map +1 -1
- package/dist/list-item.js +23 -17
- package/dist/list-item.js.map +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.cjs.map +1 -1
- package/dist/list.js +1 -1
- package/dist/list.js.map +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.cjs.map +1 -1
- package/dist/menu.js +1 -1
- package/dist/menu.js.map +1 -1
- package/dist/navbar.cjs +2 -2
- package/dist/navbar.cjs.map +1 -1
- package/dist/navbar.js +7 -5
- package/dist/navbar.js.map +1 -1
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.cjs.map +1 -1
- package/dist/navigation-menu.js +1 -1
- package/dist/navigation-menu.js.map +1 -1
- package/dist/overlay/popover/popover.css.cjs +1 -1
- package/dist/overlay/popover/popover.css.cjs.map +1 -1
- package/dist/overlay/popover/popover.css.js +1 -1
- package/dist/overlay/popover/popover.css.js.map +1 -1
- package/dist/overlay/popover/popover.d.ts +1 -0
- package/dist/overlay/popover/popover.d.ts.map +1 -1
- package/dist/overlay/shared/use-dialog.cjs +1 -1
- package/dist/overlay/shared/use-dialog.cjs.map +1 -1
- package/dist/overlay/shared/use-dialog.js +1 -1
- package/dist/overlay/shared/use-dialog.js.map +1 -1
- package/dist/overlay/shared/use-floating-trigger.cjs +1 -1
- package/dist/overlay/shared/use-floating-trigger.cjs.map +1 -1
- package/dist/overlay/shared/use-floating-trigger.js +1 -1
- package/dist/overlay/shared/use-floating-trigger.js.map +1 -1
- package/dist/popover.cjs.map +1 -1
- package/dist/popover.js.map +1 -1
- package/dist/radio.cjs +1 -1
- package/dist/radio.cjs.map +1 -1
- package/dist/radio.js +10 -8
- package/dist/radio.js.map +1 -1
- package/dist/rating.cjs +1 -1
- package/dist/rating.cjs.map +1 -1
- package/dist/rating.js +1 -1
- package/dist/rating.js.map +1 -1
- package/dist/refine.cjs +372 -323
- package/dist/refine.cjs.map +1 -1
- package/dist/refine.iife.js +372 -323
- package/dist/refine.iife.js.map +1 -1
- package/dist/refine.js +402 -353
- package/dist/refine.js.map +1 -1
- package/dist/select.cjs +16 -14
- package/dist/select.cjs.map +1 -1
- package/dist/select.js +118 -112
- package/dist/select.js.map +1 -1
- package/dist/sidebar.cjs +28 -23
- package/dist/sidebar.cjs.map +1 -1
- package/dist/sidebar.js +112 -77
- package/dist/sidebar.js.map +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.cjs.map +1 -1
- package/dist/slider.js +1 -1
- package/dist/slider.js.map +1 -1
- package/dist/stats.cjs +18 -0
- package/dist/stats.cjs.map +1 -0
- package/dist/stats.js +88 -0
- package/dist/stats.js.map +1 -0
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.cjs.map +1 -1
- package/dist/stepper.js +1 -1
- package/dist/stepper.js.map +1 -1
- package/dist/styles/mixins/animation.css.cjs +2 -0
- package/dist/styles/mixins/animation.css.cjs.map +1 -1
- package/dist/styles/mixins/animation.css.d.ts.map +1 -1
- package/dist/styles/mixins/animation.css.js +2 -0
- package/dist/styles/mixins/animation.css.js.map +1 -1
- package/dist/tab-item.cjs +1 -1
- package/dist/tab-item.cjs.map +1 -1
- package/dist/tab-item.js +3 -2
- package/dist/tab-item.js.map +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.cjs.map +1 -1
- package/dist/tabs.js +3 -1
- package/dist/tabs.js.map +1 -1
- package/dist/toast.cjs.map +1 -1
- package/dist/toast.js.map +1 -1
- package/package.json +64 -56
package/dist/combobox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.js","names":[],"sources":["../src/inputs/combobox/combobox.ts"],"sourcesContent":["import {\n bind,\n define,\n getHost,\n html,\n onCleanup,\n onElement,\n prop,\n ref,\n useEmit,\n useField,\n watchEffect,\n} from '@vielzeug/ore';\nimport { computed, signal } from '@vielzeug/ripple';\nimport {\n createChoiceField,\n createInteraction,\n createListboxDropdown,\n type DropdownCloseReason,\n lifecycleSignal,\n type OverlayOpenReason,\n} from '../../core';\nimport { colorThemeMixin, reducedMotionMixin, roundedVariantMixin, srOnlyMixin } from '../../styles';\nimport type { AddEventListeners, ComponentSize, RoundedSize, ThemeColor } from '../../types';\nimport { dispatchNativeFieldEvent } from '../shared/native-field-event';\nimport type { ComboboxOptionInput, ComboboxOptionItem, OreComboboxEvents, OreComboboxProps } from './combobox.types';\nimport { filterOptions, getCreatableLabel, makeCreatableValue, parseSlottedOptions } from './combobox-options';\nimport '../../feedback/chip/chip';\nimport '../input/input';\nimport componentStyles from './combobox.css?inline';\n\nexport type { OreComboboxEvents, OreComboboxProps } from './combobox.types';\n\n/**\n * A searchable select field with multiple selection, custom option creation, and large-list support.\n *\n * @element ore-combobox\n *\n * @attr {string} value - Selected value(s). Use comma-separated for multiple.\n * @attr {boolean} multiple - Enable multiple selection\n * @attr {boolean} creatable - Allow users to create custom options from search query\n * @attr {boolean} no-filter - Disable client-side filtering (useful for server-side search)\n * @attr {string} placeholder - Placeholder text\n * @attr {boolean} required - Require a non-blank selection for native form validation\n * @attr {boolean} success - Show an inline success check icon (suppressed while `error` is set)\n *\n * @fires input - Emitted when the selection changes.\n * @fires change - Emitted when the selection changes.\n * @fires open-change - Emitted when the dropdown state changes. detail: { open, reason }\n * @fires {CustomEvent} search - Emitted when user types. detail: { query: string }\n *\n * @slot - Slotted combobox options and option groups\n * @cssprop --combobox-dropdown-bg - Dropdown panel background color\n * @cssprop --combobox-dropdown-border-color - Dropdown panel border color\n * @cssprop --combobox-option-hover-bg - Option background on hover\n * @cssprop --combobox-option-focus-bg - Option background when keyboard-focused\n * @cssprop --combobox-option-selected-bg - Option background when selected\n * @cssprop --combobox-option-selected-focus-bg - Option background when selected and focused\n * @cssprop --input-bg - Field background (passed through to ore-input)\n * @cssprop --input-border-color - Field border color (passed through to ore-input)\n *\n * @part wrapper - Root wrapper around the entire field\n * @part label - Label element shown inside or outside the field\n * @part field - Field container that holds the trigger input and clear button\n * @part input - Search input used to filter and select options\n * @part clear-btn - Button that clears the current selection/query\n * @part dropdown - Popup list container for options\n * @part helper-text - Helper text displayed below the field\n * @example\n * ```html\n * <ore-combobox label=\"Country\" name=\"country\">\n * <ore-combobox-option value=\"us\">United States</ore-combobox-option>\n * <ore-combobox-option value=\"gb\">United Kingdom</ore-combobox-option>\n * <ore-combobox-option value=\"de\" disabled>Germany</ore-combobox-option>\n * </ore-combobox>\n * ```\n */\nexport const COMBOBOX_TAG = 'ore-combobox' as const;\ndefine<OreComboboxProps>(COMBOBOX_TAG, {\n formAssociated: true,\n props: {\n autoclose: prop.bool(false),\n color: prop.string<ThemeColor>(),\n creatable: prop.bool(false),\n disabled: prop.bool(false),\n error: prop.string(),\n fullwidth: prop.bool(false),\n helper: prop.string(),\n label: prop.string(),\n 'label-placement': prop.oneOf(['inset', 'outside'] as const, 'inset'),\n loading: prop.bool(false),\n multiple: prop.bool(false),\n name: prop.string(),\n 'no-filter': prop.bool(false),\n options: prop.data<ComboboxOptionInput[]>(),\n placeholder: prop.string('Select...'),\n required: prop.bool(false),\n rounded: prop.string<RoundedSize>(),\n size: prop.string<ComponentSize>(),\n success: prop.bool(false),\n value: prop.string(),\n variant: prop.string<'flat' | 'solid' | 'bordered' | 'outline' | 'ghost'>(),\n },\n setup(props) {\n const el = getHost();\n const emit = useEmit<OreComboboxEvents>();\n const watch = watchEffect;\n\n const query = signal('');\n\n // Element refs needed by the listbox dropdown.\n let inputEl: HTMLInputElement | null = null;\n let fieldEl: HTMLElement | null = null; // set to the ore-input host once it mounts\n let dropdownEl: HTMLElement | null = null;\n let listboxEl: HTMLElement | null = null;\n\n // Ref to the ore-input host; resolved when the template renders.\n const bitInputRef = ref<HTMLElement>();\n\n const abortSignal = lifecycleSignal(onCleanup);\n const choice = createChoiceField({\n disabled: props.disabled,\n error: props.error,\n helper: props.helper,\n label: props.label,\n labelPlacement: props['label-placement'],\n multiple: props.multiple,\n prefix: 'combobox',\n required: props.required,\n signal: abortSignal,\n value: props.value,\n });\n\n // filteredOptions signal declared before optionList so the getItems getter\n // captures the live signal reference rather than needing a factory indirection.\n const filteredOptions = signal<ComboboxOptionItem[]>([]);\n\n const optionList = createListboxDropdown<ComboboxOptionItem>({\n getBoundary: () => el,\n getFocusedOptionElement: () => dropdownEl?.querySelector<HTMLElement>('[data-focused]') ?? null,\n getItems: () => filteredOptions.value,\n getOptionId: (index) => `${choice.fieldId}-opt-${index}`,\n getPanel: () => dropdownEl,\n getReference: () => fieldEl,\n getTrigger: () => inputEl,\n isDisabled: () => choice.disabled.value,\n isItemDisabled: (option) => option.disabled,\n onClose: (reason) => {\n emit('open-change', { open: false, reason });\n\n if (!abortSignal.aborted) restoreQueryFromSelection();\n\n choice.triggerValidation('blur');\n },\n onOpen: (reason) => emit('open-change', { open: true, reason }),\n restoreFocus: false,\n signal: abortSignal,\n });\n\n const { disabled: isDisabled, fieldId: comboId, selectedValues, triggerValidation } = choice;\n\n choice.attachFormField(\n useField<string>({\n disabled: choice.disabled,\n onReset: choice.reset,\n toFormValue: (v) => v,\n validationMessage: choice.validationMessage,\n validity: choice.validity,\n value: choice.formValue,\n }),\n );\n\n const { focusedIndex, isOpen, scrollFocusedIntoView, updatePosition } = optionList;\n // ── State ────────────────────────────────────────────────────────────────\n const isMultiple = () => Boolean(props.multiple.value);\n const isCreatable = () => Boolean(props.creatable.value);\n const isNoFilter = () => Boolean(props['no-filter'].value);\n\n bind({\n attr: {\n open: () => (isOpen.value ? true : undefined),\n size: props.size,\n variant: props.variant,\n },\n });\n\n let lastQueryBeforeClear: string | null = null;\n let isRestoringQuery = false;\n\n const selectedValue = computed(() => selectedValues.value[0] ?? '');\n\n // Expose a native-like, string-valued `.value` property on the host.\n Object.defineProperty(el, 'value', {\n configurable: true,\n get: () => choice.formValue.value,\n set: (val: unknown) => {\n const v = val as string | string[] | null | undefined;\n\n if (Array.isArray(v)) {\n choice.setValues(v.map((entry) => String(entry ?? '')));\n\n return;\n }\n\n if (v == null || v === '') {\n choice.clear();\n\n return;\n }\n\n choice.setValues(isMultiple() ? String(v).split(',') : [String(v)]);\n },\n });\n\n const hasValue = () => selectedValues.value.length > 0;\n\n function focusLiveInput() {\n inputEl?.focus();\n }\n\n // ── Options ──────────────────────────────────────────────────────────────\n const slottedOptions = signal<ComboboxOptionItem[]>([]);\n const createdOptions = signal<ComboboxOptionItem[]>([]);\n const isLoading = () => Boolean(props.loading.value);\n\n function normalizeOption(option: ComboboxOptionInput): ComboboxOptionItem {\n return {\n disabled: Boolean(option.disabled),\n iconEl: option.iconEl ?? null,\n label: option.label ?? option.value,\n value: option.value,\n };\n }\n\n // Merged options: explicit prop value overrides slotted options.\n const allOptions = computed<ComboboxOptionItem[]>(() => {\n const optionsProp = props.options.value;\n const base = Array.isArray(optionsProp) ? optionsProp.map(normalizeOption) : slottedOptions.value;\n\n if (createdOptions.value.length === 0) return base;\n\n return [...base, ...createdOptions.value];\n });\n\n const selectionController = {\n clear: () => {\n choice.clear();\n },\n remove: (key: string) => {\n choice.removeValue(key);\n },\n select: (key: string) => {\n choice.selectValue(key);\n },\n toggle: (key: string) => {\n choice.toggleValue(key);\n },\n };\n\n function readOptions(elements: Element[] = Array.from(el.children)) {\n slottedOptions.value = parseSlottedOptions(elements);\n\n if (!isMultiple()) {\n const match = allOptions.value.find((option) => option.value === selectedValue.value);\n\n query.value = match?.label ?? selectedValue.value;\n }\n }\n\n // Initialize from light DOM immediately; onMounted/observer keep this in sync afterwards.\n readOptions();\n\n watch(() => {\n const nextOptions = filterOptions(allOptions.value, query.value, isNoFilter());\n\n filteredOptions.value = isMultiple()\n ? nextOptions.filter((option) => !selectedValues.value.includes(option.value))\n : nextOptions;\n });\n\n // \"Create\" option shown when creatable + query doesn't match any existing option\n const creatableLabel = computed(() => {\n return getCreatableLabel(query.value, isCreatable(), filteredOptions.value);\n });\n const inputPlaceholder = () =>\n isMultiple() && selectedValues.value.length > 0 ? '' : props.placeholder.value || '';\n\n function emitChange() {\n dispatchNativeFieldEvent(el, 'input');\n dispatchNativeFieldEvent(el, 'change');\n }\n\n function removeChip(event: Event): void {\n event.stopPropagation();\n\n const value = (event as CustomEvent<{ value?: string }>).detail?.value;\n\n if (value === undefined) return;\n\n selectionController.remove(value);\n emitChange();\n triggerValidation('change');\n }\n\n function restoreQueryFromSelection() {\n // Keep input text and selected value in sync whenever the popup closes.\n if (!isMultiple()) {\n const match = allOptions.value.find((option) => option.value === selectedValue.value);\n\n isRestoringQuery = true;\n query.value = match?.label ?? '';\n Promise.resolve().then(() => {\n isRestoringQuery = false;\n });\n\n return;\n }\n\n query.value = '';\n }\n\n watch(() => {\n if (isOpen.value && !isMultiple() && selectedValue.value && focusedIndex.value === -1 && query.value === '') {\n const selectedIndex = filteredOptions.value.findIndex((option) => option.value === selectedValue.value);\n\n if (selectedIndex >= 0) {\n optionList.set(selectedIndex);\n }\n }\n });\n\n // ── Open / Close ─────────────────────────────────────────────────────────\n function openPopup(clearFilter = true, reason: OverlayOpenReason = 'programmatic') {\n if (clearFilter) {\n lastQueryBeforeClear = query.value;\n query.value = '';\n }\n\n // Pre-compute focused index BEFORE opening so the first render has it set\n if (!isMultiple() && selectedValue.value) {\n const freshOptions = filterOptions(allOptions.value, '', isNoFilter());\n const selectedIndex = freshOptions.findIndex((option) => option.value === selectedValue.value);\n\n if (selectedIndex >= 0) {\n optionList.set(selectedIndex);\n }\n }\n\n optionList.open(reason);\n\n if (!isMultiple() && selectedValue.value && focusedIndex.value >= 0) {\n requestAnimationFrame(() => {\n scrollFocusedIntoView();\n });\n }\n }\n\n function closePopup(reason: DropdownCloseReason = 'programmatic') {\n optionList.close(reason);\n }\n\n const fieldPress = createInteraction({\n disabled: isDisabled,\n onPress: () => {\n if (!isOpen.value) openPopup(true, 'click');\n\n focusLiveInput();\n },\n });\n\n const enterPress = createInteraction({\n disabled: isDisabled,\n keys: ['Enter'],\n onPress: (originalEvent: Event) => {\n const opts = filteredOptions.value;\n\n if (isOpen.value && focusedIndex.value >= 0 && focusedIndex.value < opts.length) {\n selectOption(opts[focusedIndex.value], originalEvent);\n } else if (isOpen.value && focusedIndex.value === -1 && creatableLabel.value) {\n // Focused on the \"create\" item\n createOption(query.value, originalEvent);\n } else if (!isOpen.value) {\n openPopup(true, 'keyboard');\n }\n },\n });\n\n // ── Selection ────────────────────────────────────────────────────────────\n function selectOption(opt: ComboboxOptionItem, _originalEvent?: Event) {\n if (opt.disabled) return;\n\n if (isMultiple()) {\n selectionController.toggle(opt.value);\n query.value = '';\n emitChange();\n triggerValidation('change');\n\n if (props.autoclose.value) {\n closePopup();\n }\n\n // Keep dropdown open in multiple mode (unless autoclose is true)\n focusLiveInput();\n requestAnimationFrame(() => focusLiveInput());\n } else {\n selectionController.select(opt.value);\n query.value = opt.label;\n emitChange();\n triggerValidation('change');\n closePopup();\n focusLiveInput();\n }\n }\n function resolveOptionFromElement(optionEl: HTMLElement): ComboboxOptionItem | null {\n const indexAttr = optionEl.getAttribute('data-option-index');\n const index = indexAttr ? Number(indexAttr) : -1;\n\n if (Number.isInteger(index) && index >= 0 && index < filteredOptions.value.length) {\n return filteredOptions.value[index] ?? null;\n }\n\n const valueAttr = optionEl.getAttribute('data-option-value');\n\n if (valueAttr) {\n const byValue = filteredOptions.value.find((option) => option.value === valueAttr);\n\n if (byValue) return byValue;\n }\n\n const labelText = optionEl.querySelector('span')?.textContent?.trim() ?? optionEl.textContent?.trim() ?? '';\n\n if (!labelText) return null;\n\n return filteredOptions.value.find((option) => option.label === labelText || option.value === labelText) ?? null;\n }\n function clearValue(e: Event) {\n e.stopPropagation();\n selectionController.clear();\n query.value = '';\n emitChange();\n triggerValidation('change');\n focusLiveInput();\n }\n function handleInput(e: InputEvent) {\n const target = e.target as HTMLInputElement;\n const newValue = target.value;\n\n // Skip all input processing if we're in the middle of restoring the query\n // This prevents the clearing logic from firing during close/restore\n if (isRestoringQuery) {\n return;\n }\n\n if (newValue === query.value) return;\n\n query.value = newValue;\n\n if (!isMultiple()) {\n const currentItem = selectedValues.value[0];\n const currentLabel = currentItem\n ? (allOptions.value.find((o) => o.value === currentItem)?.label ?? currentItem)\n : '';\n\n // Preserve the current selection while typing. Selection should only\n // change when a new option is committed or when the user explicitly clears.\n const isJustOpening = newValue === '' && lastQueryBeforeClear === currentLabel;\n\n if (isJustOpening) {\n lastQueryBeforeClear = null;\n }\n }\n\n optionList.navigate('first');\n\n if (!isOpen.value) openPopup(false, 'keyboard');\n\n emit('search', { query: target.value });\n }\n function handleFocus() {\n // Intentionally no-op: open only on explicit click or keyboard.\n // Opening on every focus surprises users tabbing through a form.\n }\n\n // ── Keyboard Navigation ──────────────────────────────────────────────────\n function handleKeydown(e: KeyboardEvent) {\n if (isDisabled.value) return;\n\n if (optionList.handleKeydown(e)) return;\n\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n\n if (!isOpen.value) {\n openPopup(true, 'keyboard');\n optionList.navigate('first');\n } else {\n optionList.navigate('next');\n }\n\n break;\n case 'ArrowUp':\n e.preventDefault();\n\n if (!isOpen.value) {\n openPopup(true, 'keyboard');\n } else {\n optionList.navigate('prev');\n }\n\n break;\n case 'Backspace':\n // In multiple mode, remove the last chip when the input is empty\n if (isMultiple() && !query.value && selectedValues.value.length > 0) {\n choice.removeValue(selectedValues.value[selectedValues.value.length - 1] ?? '');\n emitChange();\n triggerValidation('change');\n }\n\n break;\n case 'Enter':\n enterPress.handleKeydown(e);\n\n break;\n case 'Tab':\n closePopup('programmatic');\n break;\n default:\n break;\n }\n }\n\n // ── Create option ────────────────────────────────────────────────────────\n function createOption(rawQuery: string, originalEvent?: Event) {\n const actualLabel = rawQuery.trim();\n\n if (!actualLabel) return;\n\n const value = makeCreatableValue(actualLabel);\n const newOpt: ComboboxOptionItem = { disabled: false, iconEl: null, label: actualLabel, value };\n\n createdOptions.value = [...createdOptions.value, newOpt];\n selectOption(newOpt, originalEvent);\n }\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n const observeLightDomOptions = (): (() => void) => {\n const observer = new MutationObserver(() => {\n readOptions();\n });\n\n observer.observe(el, {\n attributeFilter: ['disabled', 'label', 'value'],\n attributes: true,\n childList: true,\n subtree: true,\n });\n\n return () => observer.disconnect();\n };\n\n const stopObserving = observeLightDomOptions();\n\n const createListboxListeners = (listEl: HTMLElement): (() => void) => {\n const handleActivate = (event: Event) => {\n const target = event.target;\n\n if (!(target instanceof Element)) return;\n\n const createRow = target.closest<HTMLElement>('.no-results-create');\n\n if (createRow) {\n event.preventDefault();\n event.stopPropagation();\n createOption(query.value, event);\n\n return;\n }\n\n const optionEl = target.closest<HTMLElement>('.option');\n\n if (!optionEl) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n const option = resolveOptionFromElement(optionEl);\n\n if (!option || option.disabled) return;\n\n selectOption(option, event);\n };\n\n const handlePointerMove = (event: PointerEvent) => {\n const target = event.target;\n\n if (!(target instanceof Element)) return;\n\n const optionEl = target.closest<HTMLElement>('.option');\n\n if (!optionEl) return;\n\n const option = resolveOptionFromElement(optionEl);\n\n if (!option) return;\n\n const focusedIdx = filteredOptions.value.findIndex((candidate) => candidate.value === option.value);\n\n if (focusedIdx >= 0) {\n optionList.set(focusedIdx);\n }\n };\n\n listEl.addEventListener('click', handleActivate);\n listEl.addEventListener('pointermove', handlePointerMove);\n\n return () => {\n listEl.removeEventListener('click', handleActivate);\n listEl.removeEventListener('pointermove', handlePointerMove);\n };\n };\n\n let stopListboxListeners: (() => void) | null = null;\n let listboxListenersTarget: HTMLElement | null = null;\n\n const setListboxElement = (el: HTMLElement | null): void => {\n listboxEl = el;\n\n if (listboxListenersTarget === el) return;\n\n stopListboxListeners?.();\n stopListboxListeners = null;\n listboxListenersTarget = null;\n\n if (!el) return;\n\n stopListboxListeners = createListboxListeners(el);\n listboxListenersTarget = el;\n };\n\n const ensureListboxListeners = (): void => {\n if (!listboxEl) return;\n\n if (listboxListenersTarget === listboxEl && stopListboxListeners) return;\n\n stopListboxListeners?.();\n stopListboxListeners = createListboxListeners(listboxEl);\n listboxListenersTarget = listboxEl;\n };\n\n watch(() => {\n ensureListboxListeners();\n\n if (isOpen.value) {\n if (dropdownEl && 'showPopover' in dropdownEl && !dropdownEl.matches(':popover-open')) dropdownEl.showPopover();\n\n updatePosition();\n } else {\n if (dropdownEl && 'hidePopover' in dropdownEl && dropdownEl.matches(':popover-open')) dropdownEl.hidePopover();\n }\n });\n\n // Once ore-input is in the DOM, grab its inner <input> from its shadow root\n // and attach all combobox-specific ARIA + event handlers imperatively.\n // MUST be registered before the ARIA effects below so inputEl is set first\n // when bitInputRef fires (effects run in registration order).\n onElement(bitInputRef, (bitInputEl) => {\n fieldEl = bitInputEl;\n\n const rawInput = bitInputEl.shadowRoot?.querySelector<HTMLInputElement>('input') ?? null;\n\n if (!rawInput) return;\n\n inputEl = rawInput;\n\n rawInput.setAttribute('role', 'combobox');\n rawInput.setAttribute('autocomplete', 'off');\n rawInput.setAttribute('aria-autocomplete', 'list');\n rawInput.setAttribute('aria-haspopup', 'listbox');\n rawInput.setAttribute('spellcheck', 'false');\n rawInput.setAttribute('aria-controls', `${comboId}-listbox`);\n\n const handleInputClick = (): void => {\n if (!isOpen.value) openPopup(true, 'click');\n\n focusLiveInput();\n };\n\n rawInput.addEventListener('input', handleInput as EventListener);\n rawInput.addEventListener('keydown', handleKeydown as EventListener);\n rawInput.addEventListener('focus', handleFocus);\n rawInput.addEventListener('click', handleInputClick);\n\n return () => {\n inputEl = null;\n fieldEl = null;\n rawInput.removeEventListener('input', handleInput as EventListener);\n rawInput.removeEventListener('keydown', handleKeydown as EventListener);\n rawInput.removeEventListener('focus', handleFocus);\n rawInput.removeEventListener('click', handleInputClick);\n };\n });\n\n // Reactively sync combobox-specific ARIA attrs that ore-input doesn't manage.\n // Uses bitInputRef (a signal) as the gate so the effect re-runs when the\n // inner input mounts — inputEl is a plain variable and would not trigger re-runs.\n watch(() => {\n if (!bitInputRef.value) return;\n\n const el = inputEl;\n\n if (!el) return;\n\n el.setAttribute('aria-expanded', String(isOpen.value));\n\n if (isDisabled.value) {\n el.setAttribute('aria-disabled', 'true');\n } else {\n el.removeAttribute('aria-disabled');\n }\n\n if (props.error.value) {\n el.setAttribute('aria-invalid', 'true');\n el.setAttribute('aria-errormessage', `${comboId}-error`);\n } else {\n el.removeAttribute('aria-invalid');\n el.removeAttribute('aria-errormessage');\n }\n });\n\n // Reactively sync the query signal into the raw input value.\n watch(() => {\n if (!bitInputRef.value) return;\n\n const el = inputEl;\n\n if (!el) return;\n\n if (el.value !== query.value) el.value = query.value;\n });\n\n onCleanup(() => {\n stopListboxListeners?.();\n stopListboxListeners = null;\n listboxListenersTarget = null;\n stopObserving();\n });\n\n const inputColor = () => props.color?.value ?? undefined;\n const inputSize = () => props.size?.value ?? undefined;\n const inputVariant = () => props.variant?.value ?? undefined;\n const inputRounded = () => props.rounded?.value ?? undefined;\n const inputFullwidth = () => (props.fullwidth.value ? true : undefined);\n\n return html`\n <slot></slot>\n <ore-input\n class=\"trigger\"\n ref=${bitInputRef}\n label=\"${() => props.label.value ?? ''}\"\n placeholder=\"${inputPlaceholder}\"\n label-placement=\"${() => props['label-placement'].value ?? 'inset'}\"\n color=\"${inputColor}\"\n size=\"${inputSize}\"\n variant=\"${inputVariant}\"\n rounded=\"${inputRounded}\"\n helper=\"${() => props.helper.value ?? ''}\"\n error=\"${() => props.error.value ?? ''}\"\n ?disabled=\"${isDisabled}\"\n ?required=\"${() => false}\"\n ?fullwidth=\"${inputFullwidth}\"\n ?success=\"${() => props.success.value}\"\n name=\"${() => props.name.value ?? ''}\"\n @click=\"${(e: MouseEvent) => {\n fieldPress.handleClick(e);\n }}\"\n part=\"wrapper\">\n <div slot=\"prefix\" class=\"chips-row\">\n <!-- Keep chip list diffing isolated so input node identity stays stable. -->\n <span class=\"chips-list\">\n ${() =>\n (isMultiple() ? selectedValues.value : []).map(\n (value) => html`\n <ore-chip\n value=${value}\n label=${allOptions.value.find((option) => option.value === value)?.label ?? value}\n mode=\"removable\"\n variant=\"flat\"\n size=\"sm\"\n color=\"${props.color}\"\n @remove=${removeChip}>\n ${allOptions.value.find((option) => option.value === value)?.label ?? value}\n </ore-chip>\n `,\n )}\n </span>\n </div>\n <span slot=\"suffix\" class=\"combobox-suffix\" aria-hidden=\"true\">\n <button\n class=\"clear-btn\"\n part=\"clear-btn\"\n type=\"button\"\n aria-label=\"Clear\"\n tabindex=\"-1\"\n ?hidden=${() => !hasValue()}\n @click=\"${clearValue}\">\n <ore-icon name=\"x\" size=\"12\" stroke-width=\"2.5\" aria-hidden=\"true\"></ore-icon>\n </button>\n <span class=\"combobox-suffix-end\">\n <span class=\"loader\"></span>\n <span class=\"chevron\">\n <ore-icon name=\"chevron-down\" size=\"14\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n </span>\n </span>\n </span>\n </ore-input>\n <span\n class=\"sr-only\"\n id=\"${() => `${comboId}-error`}\"\n role=\"alert\"\n aria-live=\"assertive\"\n ?hidden=\"${() => !props.error.value}\">\n ${() => props.error.value ?? ''}\n </span>\n <div\n class=\"dropdown\"\n part=\"dropdown\"\n id=\"${() => `${comboId}-dropdown`}\"\n popover=\"manual\"\n ?data-open=${() => isOpen.value}\n ref=${(el: HTMLElement | null) => {\n dropdownEl = el;\n }}>\n <div\n role=\"listbox\"\n id=\"${() => `${comboId}-listbox`}\"\n style=\"${() =>\n isOpen.value && filteredOptions.value.length > 0 ? `height:${filteredOptions.value.length * 36}px;` : ''}\"\n aria-label=\"${() => props.label.value || props.placeholder.value || 'Options'}\"\n ref=${(el: HTMLElement | null) => {\n setListboxElement(el);\n }}>\n ${() => {\n if (!isOpen.value) return '';\n\n if (isLoading()) {\n return html`\n <div class=\"dropdown-loading\">Loading...</div>\n `;\n }\n\n if (filteredOptions.value.length === 0) {\n if (creatableLabel.value) {\n return html`\n <button type=\"button\" class=\"no-results-create\" ?data-focused=${() => focusedIndex.value === -1}>\n ${creatableLabel.value}\n </button>\n `;\n }\n\n return html`\n <div class=\"no-results\" role=\"presentation\">No results found</div>\n `;\n }\n\n return filteredOptions.value.map((option, index) => {\n return html`\n <div\n class=\"option\"\n role=\"option\"\n id=\"${`${comboId}-opt-${index}`}\"\n data-option-index=\"${index}\"\n data-option-value=\"${option.value}\"\n aria-selected=\"${() =>\n String(\n isMultiple() ? selectedValues.value.includes(option.value) : selectedValue.value === option.value,\n )}\"\n aria-disabled=\"${String(option.disabled)}\"\n style=\"${`position:absolute;top:0;left:0;right:0;transform:translateY(${index * 36}px);`}\"\n ?data-focused=${() => focusedIndex.value === index}\n ?data-selected=${() =>\n isMultiple() ? selectedValues.value.includes(option.value) : selectedValue.value === option.value}\n ?data-disabled=${option.disabled}>\n <span>${option.label}</span>\n <span class=\"option-check\" aria-hidden=\"true\">\n <ore-icon name=\"check\" size=\"14\" stroke-width=\"2.5\" aria-hidden=\"true\"></ore-icon>\n </span>\n </div>\n `;\n });\n }}\n </div>\n </div>\n `;\n },\n shadow: { delegatesFocus: true },\n styles: [colorThemeMixin, reducedMotionMixin, roundedVariantMixin, srOnlyMixin, componentStyles],\n}) as unknown as AddEventListeners<OreComboboxEvents>;\n"],"mappings":";;;;;;;;;;;;;AA6EA,IAAa,IAAe;AAC5B,EAAyB,GAAc;CACrC,gBAAgB;CAChB,OAAO;EACL,WAAW,EAAK,KAAK,EAAK;EAC1B,OAAO,EAAK,OAAmB;EAC/B,WAAW,EAAK,KAAK,EAAK;EAC1B,UAAU,EAAK,KAAK,EAAK;EACzB,OAAO,EAAK,OAAO;EACnB,WAAW,EAAK,KAAK,EAAK;EAC1B,QAAQ,EAAK,OAAO;EACpB,OAAO,EAAK,OAAO;EACnB,mBAAmB,EAAK,MAAM,CAAC,SAAS,SAAS,GAAY,OAAO;EACpE,SAAS,EAAK,KAAK,EAAK;EACxB,UAAU,EAAK,KAAK,EAAK;EACzB,MAAM,EAAK,OAAO;EAClB,aAAa,EAAK,KAAK,EAAK;EAC5B,SAAS,EAAK,KAA4B;EAC1C,aAAa,EAAK,OAAO,WAAW;EACpC,UAAU,EAAK,KAAK,EAAK;EACzB,SAAS,EAAK,OAAoB;EAClC,MAAM,EAAK,OAAsB;EACjC,SAAS,EAAK,KAAK,EAAK;EACxB,OAAO,EAAK,OAAO;EACnB,SAAS,EAAK,OAA4D;CAC5E;CACA,MAAM,GAAO;EACX,IAAM,IAAK,GAAQ,GACb,IAAO,GAA2B,GAClC,IAAQ,IAER,IAAQ,EAAO,EAAE,GAGnB,IAAmC,MACnC,IAA8B,MAC9B,IAAiC,MACjC,IAAgC,MAG9B,IAAc,GAAiB,GAE/B,IAAc,GAAgB,CAAS,GACvC,IAAS,GAAkB;G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UAAU;iBACvE,MAA2B;GAChC,GAAkB,CAAE;EACtB,EAAE;kBAEK,EAAO,QAER,GAAU,IACL,CAAI;;kBAKT,EAAgB,MAAM,WAAW,IAC/B,EAAe,QACV,CAAI;wFAC6D,EAAa,UAAU,GAAG;sBAC5F,EAAe,MAAM;;oBAKtB,CAAI;;kBAKN,EAAgB,MAAM,KAAK,GAAQ,MACjC,CAAI;;;;wBAID,GAAG,EAAQ,OAAO,IAAQ;uCACX,EAAM;uCACN,EAAO,MAAM;yCAEhC,OACE,EAAW,IAAI,EAAe,MAAM,SAAS,EAAO,KAAK,IAAI,EAAc,UAAU,EAAO,KAC9F,EAAE;mCACa,OAAO,EAAO,QAAQ,EAAE;2BAChC,+DAA+D,IAAQ,GAAG,MAAM;wCACnE,EAAa,UAAU,EAAM;yCAEjD,EAAW,IAAI,EAAe,MAAM,SAAS,EAAO,KAAK,IAAI,EAAc,UAAU,EAAO,MAAM;mCACnF,EAAO,SAAS;0BACzB,EAAO,MAAM;;;;;eAM1B,IA9CyB,GA+C1B;;;;CAIV;CACA,QAAQ,EAAE,gBAAgB,GAAK;CAC/B,QAAQ;EAAC;EAAiB;EAAoB;EAAqB;EAAa;CAAe;AACjG,CAAC"}
|
|
1
|
+
{"version":3,"file":"combobox.js","names":[],"sources":["../src/inputs/combobox/combobox.ts"],"sourcesContent":["import {\n bind,\n define,\n getHost,\n html,\n onCleanup,\n onElement,\n prop,\n ref,\n useEmit,\n useField,\n watchEffect,\n} from '@vielzeug/ore';\nimport { computed, signal } from '@vielzeug/ripple';\nimport {\n createChoiceField,\n createInteraction,\n createListboxDropdown,\n type DropdownCloseReason,\n lifecycleSignal,\n type OverlayOpenReason,\n} from '../../core';\nimport { colorThemeMixin, reducedMotionMixin, roundedVariantMixin, srOnlyMixin } from '../../styles';\nimport type { AddEventListeners, ComponentSize, RoundedSize, ThemeColor } from '../../types';\nimport { dispatchNativeFieldEvent } from '../shared/native-field-event';\nimport type { ComboboxOptionInput, ComboboxOptionItem, OreComboboxEvents, OreComboboxProps } from './combobox.types';\nimport { filterOptions, getCreatableLabel, makeCreatableValue, parseSlottedOptions } from './combobox-options';\nimport '../../feedback/chip/chip';\nimport '../input/input';\nimport componentStyles from './combobox.css?inline';\n\nexport type { OreComboboxEvents, OreComboboxProps } from './combobox.types';\n\n/**\n * A searchable select field with multiple selection, custom option creation, and large-list support.\n *\n * @element ore-combobox\n *\n * @attr {string} value - Selected value(s). Use comma-separated for multiple.\n * @attr {boolean} multiple - Enable multiple selection\n * @attr {boolean} creatable - Allow users to create custom options from search query\n * @attr {boolean} no-filter - Disable client-side filtering (useful for server-side search)\n * @attr {boolean} hide-label - Hide the visible label while retaining its accessible name\n * @attr {string} placeholder - Placeholder text\n * @attr {boolean} required - Require a non-blank selection for native form validation\n * @attr {boolean} success - Show an inline success check icon (suppressed while `error` is set)\n *\n * @fires input - Emitted when the selection changes.\n * @fires change - Emitted when the selection changes.\n * @fires open-change - Emitted when the dropdown state changes. detail: { open, reason }\n * @fires {CustomEvent} search - Emitted when user types. detail: { query: string }\n *\n * @slot - Slotted combobox options and option groups\n * @cssprop --combobox-dropdown-bg - Dropdown panel background color\n * @cssprop --combobox-dropdown-border-color - Dropdown panel border color\n * @cssprop --combobox-option-hover-bg - Option background on hover\n * @cssprop --combobox-option-focus-bg - Option background when keyboard-focused\n * @cssprop --combobox-option-selected-bg - Option background when selected\n * @cssprop --combobox-option-selected-focus-bg - Option background when selected and focused\n * @cssprop --input-bg - Field background (passed through to ore-input)\n * @cssprop --input-border-color - Field border color (passed through to ore-input)\n *\n * @part wrapper - Root wrapper around the entire field\n * @part label - Label element shown inside or outside the field\n * @part field - Field container that holds the trigger input and clear button\n * @part input - Search input used to filter and select options\n * @part clear-btn - Button that clears the current selection/query\n * @part dropdown - Popup list container for options\n * @part helper-text - Helper text displayed below the field\n * @example\n * ```html\n * <ore-combobox label=\"Country\" name=\"country\">\n * <ore-combobox-option value=\"us\">United States</ore-combobox-option>\n * <ore-combobox-option value=\"gb\">United Kingdom</ore-combobox-option>\n * <ore-combobox-option value=\"de\" disabled>Germany</ore-combobox-option>\n * </ore-combobox>\n * ```\n */\nexport const COMBOBOX_TAG = 'ore-combobox' as const;\ndefine<OreComboboxProps>(COMBOBOX_TAG, {\n formAssociated: true,\n props: {\n autoclose: prop.bool(false),\n color: prop.string<ThemeColor>(),\n creatable: prop.bool(false),\n disabled: prop.bool(false),\n error: prop.string(),\n fullwidth: prop.bool(false),\n helper: prop.string(),\n 'hide-label': prop.bool(false),\n label: prop.string(),\n 'label-placement': prop.oneOf(['inset', 'outside'] as const, 'inset'),\n loading: prop.bool(false),\n multiple: prop.bool(false),\n name: prop.string(),\n 'no-filter': prop.bool(false),\n options: prop.data<ComboboxOptionInput[]>(),\n placeholder: prop.string('Select...'),\n required: prop.bool(false),\n rounded: prop.string<RoundedSize>(),\n size: prop.string<ComponentSize>(),\n success: prop.bool(false),\n value: prop.string(),\n variant: prop.string<'flat' | 'solid' | 'bordered' | 'outline' | 'ghost'>(),\n },\n setup(props) {\n const el = getHost();\n const emit = useEmit<OreComboboxEvents>();\n const watch = watchEffect;\n\n const query = signal('');\n\n // Element refs needed by the listbox dropdown.\n let inputEl: HTMLInputElement | null = null;\n let fieldEl: HTMLElement | null = null; // set to the ore-input host once it mounts\n let dropdownEl: HTMLElement | null = null;\n let listboxEl: HTMLElement | null = null;\n\n // Ref to the ore-input host; resolved when the template renders.\n const bitInputRef = ref<HTMLElement>();\n\n const abortSignal = lifecycleSignal(onCleanup);\n const choice = createChoiceField({\n disabled: props.disabled,\n error: props.error,\n helper: props.helper,\n label: props.label,\n labelPlacement: props['label-placement'],\n multiple: props.multiple,\n prefix: 'combobox',\n required: props.required,\n signal: abortSignal,\n value: props.value,\n });\n\n // filteredOptions signal declared before optionList so the getItems getter\n // captures the live signal reference rather than needing a factory indirection.\n const filteredOptions = signal<ComboboxOptionItem[]>([]);\n\n const optionList = createListboxDropdown<ComboboxOptionItem>({\n getBoundary: () => el,\n getFocusedOptionElement: () => dropdownEl?.querySelector<HTMLElement>('[data-focused]') ?? null,\n getItems: () => filteredOptions.value,\n getOptionId: (index) => `${choice.fieldId}-opt-${index}`,\n getPanel: () => dropdownEl,\n getReference: () => fieldEl,\n getTrigger: () => inputEl,\n isDisabled: () => choice.disabled.value,\n isItemDisabled: (option) => option.disabled,\n onClose: (reason) => {\n emit('open-change', { open: false, reason });\n\n if (!abortSignal.aborted) restoreQueryFromSelection();\n\n choice.triggerValidation('blur');\n },\n onOpen: (reason) => emit('open-change', { open: true, reason }),\n restoreFocus: false,\n signal: abortSignal,\n });\n\n const { disabled: isDisabled, fieldId: comboId, selectedValues, triggerValidation } = choice;\n\n choice.attachFormField(\n useField<string>({\n disabled: choice.disabled,\n onReset: choice.reset,\n toFormValue: (v) => v,\n validationMessage: choice.validationMessage,\n validity: choice.validity,\n value: choice.formValue,\n }),\n );\n\n const { focusedIndex, isOpen, scrollFocusedIntoView, updatePosition } = optionList;\n // ── State ────────────────────────────────────────────────────────────────\n const isMultiple = () => Boolean(props.multiple.value);\n const isCreatable = () => Boolean(props.creatable.value);\n const isNoFilter = () => Boolean(props['no-filter'].value);\n\n bind({\n attr: {\n open: () => (isOpen.value ? true : undefined),\n size: props.size,\n variant: props.variant,\n },\n });\n\n let lastQueryBeforeClear: string | null = null;\n let isRestoringQuery = false;\n\n const selectedValue = computed(() => selectedValues.value[0] ?? '');\n\n // Expose a native-like, string-valued `.value` property on the host.\n Object.defineProperty(el, 'value', {\n configurable: true,\n get: () => choice.formValue.value,\n set: (val: unknown) => {\n const v = val as string | string[] | null | undefined;\n\n if (Array.isArray(v)) {\n choice.setValues(v.map((entry) => String(entry ?? '')));\n\n return;\n }\n\n if (v == null || v === '') {\n choice.clear();\n\n return;\n }\n\n choice.setValues(isMultiple() ? String(v).split(',') : [String(v)]);\n },\n });\n\n const hasValue = () => selectedValues.value.length > 0;\n\n function focusLiveInput() {\n inputEl?.focus();\n }\n\n // ── Options ──────────────────────────────────────────────────────────────\n const slottedOptions = signal<ComboboxOptionItem[]>([]);\n const createdOptions = signal<ComboboxOptionItem[]>([]);\n const isLoading = () => Boolean(props.loading.value);\n\n function normalizeOption(option: ComboboxOptionInput): ComboboxOptionItem {\n return {\n disabled: Boolean(option.disabled),\n disabledReason: option.disabledReason,\n iconEl: option.iconEl ?? null,\n label: option.label ?? option.value,\n value: option.value,\n };\n }\n\n // Merged options: explicit prop value overrides slotted options.\n const allOptions = computed<ComboboxOptionItem[]>(() => {\n const optionsProp = props.options.value;\n const base = Array.isArray(optionsProp) ? optionsProp.map(normalizeOption) : slottedOptions.value;\n\n if (createdOptions.value.length === 0) return base;\n\n return [...base, ...createdOptions.value];\n });\n\n const selectionController = {\n clear: () => {\n choice.clear();\n },\n remove: (key: string) => {\n choice.removeValue(key);\n },\n select: (key: string) => {\n choice.selectValue(key);\n },\n toggle: (key: string) => {\n choice.toggleValue(key);\n },\n };\n\n function readOptions(elements: Element[] = Array.from(el.children)) {\n slottedOptions.value = parseSlottedOptions(elements);\n\n if (!isMultiple()) {\n const match = allOptions.value.find((option) => option.value === selectedValue.value);\n\n query.value = match?.label ?? selectedValue.value;\n }\n }\n\n // Initialize from light DOM immediately; onMounted/observer keep this in sync afterwards.\n readOptions();\n\n watch(() => {\n const nextOptions = filterOptions(allOptions.value, query.value, isNoFilter());\n\n filteredOptions.value = isMultiple()\n ? nextOptions.filter((option) => !selectedValues.value.includes(option.value))\n : nextOptions;\n });\n\n // \"Create\" option shown when creatable + query doesn't match any existing option\n const creatableLabel = computed(() => {\n return getCreatableLabel(query.value, isCreatable(), filteredOptions.value);\n });\n const inputPlaceholder = () =>\n isMultiple() && selectedValues.value.length > 0 ? '' : props.placeholder.value || '';\n\n function emitChange() {\n dispatchNativeFieldEvent(el, 'input');\n dispatchNativeFieldEvent(el, 'change');\n }\n\n function removeChip(event: Event): void {\n event.stopPropagation();\n\n const value = (event as CustomEvent<{ value?: string }>).detail?.value;\n\n if (value === undefined) return;\n\n selectionController.remove(value);\n emitChange();\n triggerValidation('change');\n }\n\n function restoreQueryFromSelection() {\n // Keep input text and selected value in sync whenever the popup closes.\n if (!isMultiple()) {\n const match = allOptions.value.find((option) => option.value === selectedValue.value);\n\n isRestoringQuery = true;\n query.value = match?.label ?? '';\n Promise.resolve().then(() => {\n isRestoringQuery = false;\n });\n\n return;\n }\n\n query.value = '';\n }\n\n watch(() => {\n if (isOpen.value && !isMultiple() && selectedValue.value && focusedIndex.value === -1 && query.value === '') {\n const selectedIndex = filteredOptions.value.findIndex((option) => option.value === selectedValue.value);\n\n if (selectedIndex >= 0) {\n optionList.set(selectedIndex);\n }\n }\n });\n\n // ── Open / Close ─────────────────────────────────────────────────────────\n function openPopup(clearFilter = true, reason: OverlayOpenReason = 'programmatic') {\n if (clearFilter) {\n lastQueryBeforeClear = query.value;\n query.value = '';\n }\n\n // Pre-compute focused index BEFORE opening so the first render has it set\n if (!isMultiple() && selectedValue.value) {\n const freshOptions = filterOptions(allOptions.value, '', isNoFilter());\n const selectedIndex = freshOptions.findIndex((option) => option.value === selectedValue.value);\n\n if (selectedIndex >= 0) {\n optionList.set(selectedIndex);\n }\n }\n\n optionList.open(reason);\n\n if (!isMultiple() && selectedValue.value && focusedIndex.value >= 0) {\n requestAnimationFrame(() => {\n scrollFocusedIntoView();\n });\n }\n }\n\n function closePopup(reason: DropdownCloseReason = 'programmatic') {\n optionList.close(reason);\n }\n\n const fieldPress = createInteraction({\n disabled: isDisabled,\n onPress: () => {\n if (!isOpen.value) openPopup(true, 'click');\n\n focusLiveInput();\n },\n });\n\n const enterPress = createInteraction({\n disabled: isDisabled,\n keys: ['Enter'],\n onPress: (originalEvent: Event) => {\n const opts = filteredOptions.value;\n\n if (isOpen.value && focusedIndex.value >= 0 && focusedIndex.value < opts.length) {\n selectOption(opts[focusedIndex.value], originalEvent);\n } else if (isOpen.value && focusedIndex.value === -1 && creatableLabel.value) {\n // Focused on the \"create\" item\n createOption(query.value, originalEvent);\n } else if (!isOpen.value) {\n openPopup(true, 'keyboard');\n }\n },\n });\n\n // ── Selection ────────────────────────────────────────────────────────────\n function selectOption(opt: ComboboxOptionItem, _originalEvent?: Event) {\n if (opt.disabled) return;\n\n if (isMultiple()) {\n selectionController.toggle(opt.value);\n query.value = '';\n emitChange();\n triggerValidation('change');\n\n if (props.autoclose.value) {\n closePopup();\n }\n\n // Keep dropdown open in multiple mode (unless autoclose is true)\n focusLiveInput();\n requestAnimationFrame(() => focusLiveInput());\n } else {\n selectionController.select(opt.value);\n query.value = opt.label;\n emitChange();\n triggerValidation('change');\n closePopup();\n focusLiveInput();\n }\n }\n function resolveOptionFromElement(optionEl: HTMLElement): ComboboxOptionItem | null {\n const indexAttr = optionEl.getAttribute('data-option-index');\n const index = indexAttr ? Number(indexAttr) : -1;\n\n if (Number.isInteger(index) && index >= 0 && index < filteredOptions.value.length) {\n return filteredOptions.value[index] ?? null;\n }\n\n const valueAttr = optionEl.getAttribute('data-option-value');\n\n if (valueAttr) {\n const byValue = filteredOptions.value.find((option) => option.value === valueAttr);\n\n if (byValue) return byValue;\n }\n\n const labelText = optionEl.querySelector('span')?.textContent?.trim() ?? optionEl.textContent?.trim() ?? '';\n\n if (!labelText) return null;\n\n return filteredOptions.value.find((option) => option.label === labelText || option.value === labelText) ?? null;\n }\n function clearValue(e: Event) {\n e.stopPropagation();\n selectionController.clear();\n query.value = '';\n emitChange();\n triggerValidation('change');\n focusLiveInput();\n }\n function handleInput(e: InputEvent) {\n const target = e.target as HTMLInputElement;\n const newValue = target.value;\n\n // Skip all input processing if we're in the middle of restoring the query\n // This prevents the clearing logic from firing during close/restore\n if (isRestoringQuery) {\n return;\n }\n\n if (newValue === query.value) return;\n\n query.value = newValue;\n\n if (!isMultiple()) {\n const currentItem = selectedValues.value[0];\n const currentLabel = currentItem\n ? (allOptions.value.find((o) => o.value === currentItem)?.label ?? currentItem)\n : '';\n\n // Preserve the current selection while typing. Selection should only\n // change when a new option is committed or when the user explicitly clears.\n const isJustOpening = newValue === '' && lastQueryBeforeClear === currentLabel;\n\n if (isJustOpening) {\n lastQueryBeforeClear = null;\n }\n }\n\n optionList.navigate('first');\n\n if (!isOpen.value) openPopup(false, 'keyboard');\n\n emit('search', { query: target.value });\n }\n function handleFocus() {\n // Intentionally no-op: open only on explicit click or keyboard.\n // Opening on every focus surprises users tabbing through a form.\n }\n\n // ── Keyboard Navigation ──────────────────────────────────────────────────\n function handleKeydown(e: KeyboardEvent) {\n if (isDisabled.value) return;\n\n if (optionList.handleKeydown(e)) return;\n\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n\n if (!isOpen.value) {\n openPopup(true, 'keyboard');\n optionList.navigate('first');\n } else {\n optionList.navigate('next');\n }\n\n break;\n case 'ArrowUp':\n e.preventDefault();\n\n if (!isOpen.value) {\n openPopup(true, 'keyboard');\n } else {\n optionList.navigate('prev');\n }\n\n break;\n case 'Backspace':\n // In multiple mode, remove the last chip when the input is empty\n if (isMultiple() && !query.value && selectedValues.value.length > 0) {\n choice.removeValue(selectedValues.value[selectedValues.value.length - 1] ?? '');\n emitChange();\n triggerValidation('change');\n }\n\n break;\n case 'Enter':\n enterPress.handleKeydown(e);\n\n break;\n case 'Tab':\n closePopup('programmatic');\n break;\n default:\n break;\n }\n }\n\n // ── Create option ────────────────────────────────────────────────────────\n function createOption(rawQuery: string, originalEvent?: Event) {\n const actualLabel = rawQuery.trim();\n\n if (!actualLabel) return;\n\n const value = makeCreatableValue(actualLabel);\n const newOpt: ComboboxOptionItem = { disabled: false, iconEl: null, label: actualLabel, value };\n\n createdOptions.value = [...createdOptions.value, newOpt];\n selectOption(newOpt, originalEvent);\n }\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n const observeLightDomOptions = (): (() => void) => {\n const observer = new MutationObserver(() => {\n readOptions();\n });\n\n observer.observe(el, {\n attributeFilter: ['disabled', 'disabled-reason', 'label', 'value'],\n attributes: true,\n childList: true,\n subtree: true,\n });\n\n return () => observer.disconnect();\n };\n\n const stopObserving = observeLightDomOptions();\n\n const createListboxListeners = (listEl: HTMLElement): (() => void) => {\n const handleActivate = (event: Event) => {\n const target = event.target;\n\n if (!(target instanceof Element)) return;\n\n const createRow = target.closest<HTMLElement>('.no-results-create');\n\n if (createRow) {\n event.preventDefault();\n event.stopPropagation();\n createOption(query.value, event);\n\n return;\n }\n\n const optionEl = target.closest<HTMLElement>('.option');\n\n if (!optionEl) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n const option = resolveOptionFromElement(optionEl);\n\n if (!option || option.disabled) return;\n\n selectOption(option, event);\n };\n\n const handlePointerMove = (event: PointerEvent) => {\n const target = event.target;\n\n if (!(target instanceof Element)) return;\n\n const optionEl = target.closest<HTMLElement>('.option');\n\n if (!optionEl) return;\n\n const option = resolveOptionFromElement(optionEl);\n\n if (!option) return;\n\n const focusedIdx = filteredOptions.value.findIndex((candidate) => candidate.value === option.value);\n\n if (focusedIdx >= 0) {\n optionList.set(focusedIdx);\n }\n };\n\n listEl.addEventListener('click', handleActivate);\n listEl.addEventListener('pointermove', handlePointerMove);\n\n return () => {\n listEl.removeEventListener('click', handleActivate);\n listEl.removeEventListener('pointermove', handlePointerMove);\n };\n };\n\n let stopListboxListeners: (() => void) | null = null;\n let listboxListenersTarget: HTMLElement | null = null;\n\n const setListboxElement = (el: HTMLElement | null): void => {\n listboxEl = el;\n\n if (listboxListenersTarget === el) return;\n\n stopListboxListeners?.();\n stopListboxListeners = null;\n listboxListenersTarget = null;\n\n if (!el) return;\n\n stopListboxListeners = createListboxListeners(el);\n listboxListenersTarget = el;\n };\n\n const ensureListboxListeners = (): void => {\n if (!listboxEl) return;\n\n if (listboxListenersTarget === listboxEl && stopListboxListeners) return;\n\n stopListboxListeners?.();\n stopListboxListeners = createListboxListeners(listboxEl);\n listboxListenersTarget = listboxEl;\n };\n\n watch(() => {\n ensureListboxListeners();\n\n if (isOpen.value) {\n if (dropdownEl && 'showPopover' in dropdownEl && !dropdownEl.matches(':popover-open')) dropdownEl.showPopover();\n\n updatePosition();\n } else {\n if (dropdownEl && 'hidePopover' in dropdownEl && dropdownEl.matches(':popover-open')) dropdownEl.hidePopover();\n }\n });\n\n // Once ore-input is in the DOM, grab its inner <input> from its shadow root\n // and attach all combobox-specific ARIA + event handlers imperatively.\n // MUST be registered before the ARIA effects below so inputEl is set first\n // when bitInputRef fires (effects run in registration order).\n onElement(bitInputRef, (bitInputEl) => {\n fieldEl = bitInputEl;\n\n const rawInput = bitInputEl.shadowRoot?.querySelector<HTMLInputElement>('input') ?? null;\n\n if (!rawInput) return;\n\n inputEl = rawInput;\n\n rawInput.setAttribute('role', 'combobox');\n rawInput.setAttribute('autocomplete', 'off');\n rawInput.setAttribute('aria-autocomplete', 'list');\n rawInput.setAttribute('aria-haspopup', 'listbox');\n rawInput.setAttribute('spellcheck', 'false');\n rawInput.setAttribute('aria-controls', `${comboId}-listbox`);\n\n const handleInputClick = (): void => {\n if (!isOpen.value) openPopup(true, 'click');\n\n focusLiveInput();\n };\n\n rawInput.addEventListener('input', handleInput as EventListener);\n rawInput.addEventListener('keydown', handleKeydown as EventListener);\n rawInput.addEventListener('focus', handleFocus);\n rawInput.addEventListener('click', handleInputClick);\n\n return () => {\n inputEl = null;\n fieldEl = null;\n rawInput.removeEventListener('input', handleInput as EventListener);\n rawInput.removeEventListener('keydown', handleKeydown as EventListener);\n rawInput.removeEventListener('focus', handleFocus);\n rawInput.removeEventListener('click', handleInputClick);\n };\n });\n\n // Reactively sync combobox-specific ARIA attrs that ore-input doesn't manage.\n // Uses bitInputRef (a signal) as the gate so the effect re-runs when the\n // inner input mounts — inputEl is a plain variable and would not trigger re-runs.\n watch(() => {\n if (!bitInputRef.value) return;\n\n const el = inputEl;\n\n if (!el) return;\n\n el.setAttribute('aria-expanded', String(isOpen.value));\n\n if (isDisabled.value) {\n el.setAttribute('aria-disabled', 'true');\n } else {\n el.removeAttribute('aria-disabled');\n }\n\n if (props.error.value) {\n el.setAttribute('aria-invalid', 'true');\n el.setAttribute('aria-errormessage', `${comboId}-error`);\n } else {\n el.removeAttribute('aria-invalid');\n el.removeAttribute('aria-errormessage');\n }\n });\n\n // Reactively sync the query signal into the raw input value.\n watch(() => {\n if (!bitInputRef.value) return;\n\n const el = inputEl;\n\n if (!el) return;\n\n if (el.value !== query.value) el.value = query.value;\n });\n\n onCleanup(() => {\n stopListboxListeners?.();\n stopListboxListeners = null;\n listboxListenersTarget = null;\n stopObserving();\n });\n\n const hideLabel = () => props['hide-label'].value;\n const inputAriaLabel = () => (hideLabel() ? (props.label.value ?? '') : null);\n const inputLabel = () => (hideLabel() ? '' : (props.label.value ?? ''));\n const inputColor = () => props.color?.value ?? undefined;\n const inputSize = () => props.size?.value ?? undefined;\n const inputVariant = () => props.variant?.value ?? undefined;\n const inputRounded = () => props.rounded?.value ?? undefined;\n const inputFullwidth = () => (props.fullwidth.value ? true : undefined);\n\n return html`\n <slot></slot>\n <ore-input\n class=\"trigger\"\n ref=${bitInputRef}\n aria-label=\"${inputAriaLabel}\"\n label=\"${inputLabel}\"\n placeholder=\"${inputPlaceholder}\"\n label-placement=\"${() => props['label-placement'].value ?? 'inset'}\"\n color=\"${inputColor}\"\n size=\"${inputSize}\"\n variant=\"${inputVariant}\"\n rounded=\"${inputRounded}\"\n helper=\"${() => props.helper.value ?? ''}\"\n error=\"${() => props.error.value ?? ''}\"\n ?disabled=\"${isDisabled}\"\n ?required=\"${() => false}\"\n ?fullwidth=\"${inputFullwidth}\"\n ?success=\"${() => props.success.value}\"\n name=\"${() => props.name.value ?? ''}\"\n @click=\"${(e: MouseEvent) => {\n fieldPress.handleClick(e);\n }}\"\n part=\"wrapper\">\n <div slot=\"prefix\" class=\"chips-row\">\n <!-- Keep chip list diffing isolated so input node identity stays stable. -->\n <span class=\"chips-list\">\n ${() =>\n (isMultiple() ? selectedValues.value : []).map(\n (value) => html`\n <ore-chip\n value=${value}\n label=${allOptions.value.find((option) => option.value === value)?.label ?? value}\n mode=\"removable\"\n variant=\"flat\"\n size=\"sm\"\n color=\"${props.color}\"\n @remove=${removeChip}>\n ${allOptions.value.find((option) => option.value === value)?.label ?? value}\n </ore-chip>\n `,\n )}\n </span>\n </div>\n <span slot=\"suffix\" class=\"combobox-suffix\" aria-hidden=\"true\">\n <button\n class=\"clear-btn\"\n part=\"clear-btn\"\n type=\"button\"\n aria-label=\"Clear\"\n tabindex=\"-1\"\n ?hidden=${() => !hasValue()}\n @click=\"${clearValue}\">\n <ore-icon name=\"x\" size=\"12\" stroke-width=\"2.5\" aria-hidden=\"true\"></ore-icon>\n </button>\n <span class=\"combobox-suffix-end\">\n <span class=\"loader\"></span>\n <span class=\"chevron\">\n <ore-icon name=\"chevron-down\" size=\"14\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n </span>\n </span>\n </span>\n </ore-input>\n <span\n class=\"sr-only\"\n id=\"${() => `${comboId}-error`}\"\n role=\"alert\"\n aria-live=\"assertive\"\n ?hidden=\"${() => !props.error.value}\">\n ${() => props.error.value ?? ''}\n </span>\n <div\n class=\"dropdown\"\n part=\"dropdown\"\n id=\"${() => `${comboId}-dropdown`}\"\n popover=\"manual\"\n ?data-open=${() => isOpen.value}\n ref=${(el: HTMLElement | null) => {\n dropdownEl = el;\n }}>\n <div\n role=\"listbox\"\n id=\"${() => `${comboId}-listbox`}\"\n style=\"${() =>\n isOpen.value && filteredOptions.value.length > 0 ? `height:${filteredOptions.value.length * 36}px;` : ''}\"\n aria-label=\"${() => props.label.value || props.placeholder.value || 'Options'}\"\n ref=${(el: HTMLElement | null) => {\n setListboxElement(el);\n }}>\n ${() => {\n if (!isOpen.value) return '';\n\n if (isLoading()) {\n return html`\n <div class=\"dropdown-loading\">Loading...</div>\n `;\n }\n\n if (filteredOptions.value.length === 0) {\n if (creatableLabel.value) {\n return html`\n <button type=\"button\" class=\"no-results-create\" ?data-focused=${() => focusedIndex.value === -1}>\n ${creatableLabel.value}\n </button>\n `;\n }\n\n return html`\n <div class=\"no-results\" role=\"presentation\">No results found</div>\n `;\n }\n\n return filteredOptions.value.map((option, index) => {\n return html`\n <div\n class=\"option\"\n role=\"option\"\n id=\"${`${comboId}-opt-${index}`}\"\n data-option-index=\"${index}\"\n data-option-value=\"${option.value}\"\n aria-selected=\"${() =>\n String(\n isMultiple() ? selectedValues.value.includes(option.value) : selectedValue.value === option.value,\n )}\"\n aria-disabled=\"${String(option.disabled)}\"\n style=\"${`position:absolute;top:0;left:0;right:0;transform:translateY(${index * 36}px);`}\"\n ?data-focused=${() => focusedIndex.value === index}\n ?data-selected=${() =>\n isMultiple() ? selectedValues.value.includes(option.value) : selectedValue.value === option.value}\n ?data-disabled=${option.disabled}>\n <span>${option.label}</span>\n ${\n option.disabled && option.disabledReason\n ? html`<small class=\"disabled-reason\" title=\"${option.disabledReason}\">${option.disabledReason}</small>`\n : html``\n }\n <span class=\"option-check\" aria-hidden=\"true\">\n <ore-icon name=\"check\" size=\"14\" stroke-width=\"2.5\" aria-hidden=\"true\"></ore-icon>\n </span>\n </div>\n `;\n });\n }}\n </div>\n </div>\n `;\n },\n shadow: { delegatesFocus: true },\n styles: [colorThemeMixin, reducedMotionMixin, roundedVariantMixin, srOnlyMixin, componentStyles],\n}) as unknown as AddEventListeners<OreComboboxEvents>;\n"],"mappings":";;;;;;;;;;;;;AA8EA,IAAa,IAAe;AAC5B,EAAyB,GAAc;CACrC,gBAAgB;CAChB,OAAO;EACL,WAAW,EAAK,KAAK,EAAK;EAC1B,OAAO,EAAK,OAAmB;EAC/B,WAAW,EAAK,KAAK,EAAK;EAC1B,UAAU,EAAK,KAAK,EAAK;EACzB,OAAO,EAAK,OAAO;EACnB,WAAW,EAAK,KAAK,EAAK;EAC1B,QAAQ,EAAK,OAAO;EACpB,cAAc,EAAK,KAAK,EAAK;EAC7B,OAAO,EAAK,OAAO;EACnB,mBAAmB,EAAK,MAAM,CAAC,SAAS,SAAS,GAAY,OAAO;EACpE,SAAS,EAAK,KAAK,EAAK;EACxB,UAAU,EAAK,KAAK,EAAK;EACzB,MAAM,EAAK,OAAO;EAClB,aAAa,EAAK,KAAK,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tB,CAAI,yCAAyC,EAAO,eAAe,IAAI,EAAO,eAAe,YAC7F,CAAI,GACT;;;;;eAMN,IAnDyB,GAoD1B;;;;CAIV;CACA,QAAQ,EAAE,gBAAgB,GAAK;CAC/B,QAAQ;EAAC;EAAiB;EAAoB;EAAqB;EAAa;CAAe;AACjG,CAAC"}
|
package/dist/content/index.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export type { OrePaginationEvents, OrePaginationProps } from './pagination/pagin
|
|
|
26
26
|
export { PAGINATION_TAG } from './pagination/pagination';
|
|
27
27
|
export type { OreSeparatorProps } from './separator/separator';
|
|
28
28
|
export { SEPARATOR_TAG } from './separator/separator';
|
|
29
|
+
export type { OreStatsProps, StatsTrendDirection, StatsVariant } from './stats/stats';
|
|
30
|
+
export { STATS_TAG } from './stats/stats';
|
|
29
31
|
export type { OreStepProps } from './stepper/step';
|
|
30
32
|
export { STEP_TAG } from './stepper/step';
|
|
31
33
|
export type { OreStepperEvents, OreStepperProps, StepperContext } from './stepper/stepper';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/content/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9E,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,mBAAmB,EAAE,eAAe,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B,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=`@layer refine.base{:host{--_actions-width:var(--list-item-actions-width,var(--size-24));color:var(--color-contrast-700);display:block;position:relative;overflow:hidden}.row{z-index:1;box-sizing:border-box;gap:var(--_gap,var(--size-4));width:100%;min-height:var(--_min-height,var(--size-4));padding:var(--_padding,var(--size-2-5) var(--size-4));font-size:var(--_font-size,var(--text-sm));touch-action:pan-y;cursor:default;background:var(--list-item-bg,var(--color-canvas));transform:translateX(calc(var(--_swipe-x,0) * var(--_actions-width)));transition:var(--_motion-transition,transform var(--transition-fast), background var(--transition-fast));border:none;outline:none;align-items:center;display:flex;position:relative}.row:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){text-align:left;padding-right:var(--_padding-inline-end,var(--size-6))}.row:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){text-align:right;padding-left:var(--_padding-inline-end,var(--size-6))}.leading,.trailing{flex-shrink:0;align-items:center;display:flex}.content{gap:var(--size-0-5);flex-direction:column;flex:1;min-width:0;display:flex}.title{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.description{text-overflow:ellipsis;font-size:var(--text-xs);color:var(--color-contrast-
|
|
1
|
+
var e=`@layer refine.base{:host{--_actions-width:var(--list-item-actions-width,var(--size-24));color:var(--color-contrast-700);display:block;position:relative;overflow:hidden}.row{z-index:1;box-sizing:border-box;gap:var(--_gap,var(--size-4));width:100%;min-height:var(--_min-height,var(--size-4));padding:var(--_padding,var(--size-2-5) var(--size-4));font-size:var(--_font-size,var(--text-sm));touch-action:pan-y;cursor:default;background:var(--list-item-bg,var(--color-canvas));transform:translateX(calc(var(--_swipe-x,0) * var(--_actions-width)));transition:var(--_motion-transition,transform var(--transition-fast), background var(--transition-fast));border:none;outline:none;align-items:center;display:flex;position:relative}.row:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){text-align:left;padding-right:var(--_padding-inline-end,var(--size-6))}.row:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){text-align:right;padding-left:var(--_padding-inline-end,var(--size-6))}:host([data-two-line]) .row{min-height:var(--_min-height-two-line,var(--size-18))}:host([actionable]) .row{cursor:pointer}.leading,.trailing{flex-shrink:0;align-items:center;display:flex}.leading[hidden],.trailing[hidden]{display:none}.content{gap:var(--size-0-5);flex-direction:column;flex:1;min-width:0;display:flex}.title{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.description{text-overflow:ellipsis;font-size:var(--text-xs);color:var(--color-contrast-600);white-space:nowrap;display:block;overflow:hidden}.description:empty{display:none}.row:hover{background:var(--list-item-hover-bg,var(--color-contrast-100))}.row:focus-visible{outline:var(--focus-ring);outline-offset:-2px}:host([selected]) .row{color:var(--color-primary);background:var(--list-item-selected-bg,color-mix(in oklch, var(--color-primary) 10%, transparent))}:host([disabled]){pointer-events:none;opacity:.6}.actions{width:var(--_actions-width);transition:var(--_motion-transition,transform var(--transition-fast));align-items:stretch;display:flex;position:absolute;top:0;bottom:0}.actions ::slotted(*){flex:1;height:100%}.actions-left{transform:translateX(calc((var(--_swipe-x,0) - 1) * 100%));left:0}.actions-right{transform:translateX(calc((var(--_swipe-x,0) + 1) * 100%));right:0}:host([revealed=left]){--_swipe-x:1}:host([revealed=right]){--_swipe-x:-1}:host:has(.actions-left:focus-within){--_swipe-x:1}:host:has(.actions-right:focus-within){--_swipe-x:-1}:host([data-dragging]) .row,:host([data-dragging]) .actions-left,:host([data-dragging]) .actions-right{transition:none}:host([data-confirming]) .actions-left,:host([data-confirming]) .actions-right{filter:saturate(1.4)brightness(.94)}}`;exports.default=e;
|
|
2
2
|
//# sourceMappingURL=list-item.css.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.css.cjs","names":[],"sources":["../../../src/content/list/list-item.css?inline"],"sourcesContent":["@layer refine.base {\n /* `--_gap` / `--_padding` / `--_font-size` are intentionally not emitted by any mixin in this\n component's own `styles` array — they're inherited from the parent `ore-list`'s\n `sizeVariantMixin(LIST_SIZE_PRESET)` call the same way `ore-menu-item` inherits\n `--_gap`/`--_font-size` from `ore-menu` (see `LIST_SIZE_PRESET`'s doc comment). The\n `var(..., fallback)` defaults below cover standalone use outside an `ore-list`. */\n :host {\n --_actions-width: var(--list-item-actions-width, var(--size-24));\n position: relative;\n display: block;\n overflow: hidden;\n color: var(--color-contrast-700);\n }\n\n /* ========================================\n Row\n ======================================== */\n\n .row {\n position: relative;\n z-index: 1;\n box-sizing: border-box;\n display: flex;\n gap: var(--_gap, var(--size-4));\n align-items: center;\n width: 100%;\n min-height: var(--_min-height, var(--size-4));\n padding: var(--_padding, var(--size-2-5) var(--size-4));\n padding-inline-end: var(--_padding-inline-end, var(--size-6));\n font-size: var(--_font-size, var(--text-sm));\n text-align: start;\n touch-action: pan-y;\n cursor: default;\n outline: none;\n background: var(--list-item-bg, var(--color-canvas));\n border: none;\n transform: translateX(calc(var(--_swipe-x, 0) * var(--_actions-width)));\n transition: var(--_motion-transition, transform var(--transition-fast), background var(--transition-fast));\n }\n\n .leading,\n .trailing {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n }\n\n .content {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--size-0-5);\n min-width: 0;\n }\n\n .title {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .description {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--text-xs);\n color: var(--color-contrast-
|
|
1
|
+
{"version":3,"file":"list-item.css.cjs","names":[],"sources":["../../../src/content/list/list-item.css?inline"],"sourcesContent":["@layer refine.base {\n /* `--_gap` / `--_padding` / `--_font-size` are intentionally not emitted by any mixin in this\n component's own `styles` array — they're inherited from the parent `ore-list`'s\n `sizeVariantMixin(LIST_SIZE_PRESET)` call the same way `ore-menu-item` inherits\n `--_gap`/`--_font-size` from `ore-menu` (see `LIST_SIZE_PRESET`'s doc comment). The\n `var(..., fallback)` defaults below cover standalone use outside an `ore-list`. */\n :host {\n --_actions-width: var(--list-item-actions-width, var(--size-24));\n position: relative;\n display: block;\n overflow: hidden;\n color: var(--color-contrast-700);\n }\n\n /* ========================================\n Row\n ======================================== */\n\n .row {\n position: relative;\n z-index: 1;\n box-sizing: border-box;\n display: flex;\n gap: var(--_gap, var(--size-4));\n align-items: center;\n width: 100%;\n min-height: var(--_min-height, var(--size-4));\n padding: var(--_padding, var(--size-2-5) var(--size-4));\n padding-inline-end: var(--_padding-inline-end, var(--size-6));\n font-size: var(--_font-size, var(--text-sm));\n text-align: start;\n touch-action: pan-y;\n cursor: default;\n outline: none;\n background: var(--list-item-bg, var(--color-canvas));\n border: none;\n transform: translateX(calc(var(--_swipe-x, 0) * var(--_actions-width)));\n transition: var(--_motion-transition, transform var(--transition-fast), background var(--transition-fast));\n }\n\n :host([data-two-line]) .row {\n min-height: var(--_min-height-two-line, var(--size-18));\n }\n\n :host([actionable]) .row {\n cursor: pointer;\n }\n\n .leading,\n .trailing {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n }\n\n .leading[hidden],\n .trailing[hidden] {\n display: none;\n }\n\n .content {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--size-0-5);\n min-width: 0;\n }\n\n .title {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .description {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--text-xs);\n color: var(--color-contrast-600);\n white-space: nowrap;\n }\n\n .description:empty {\n display: none;\n }\n\n .row:hover {\n background: var(--list-item-hover-bg, var(--color-contrast-100));\n }\n\n .row:focus-visible {\n outline: var(--focus-ring);\n outline-offset: -2px;\n }\n\n /* ========================================\n Selected / Disabled States\n ======================================== */\n\n :host([selected]) .row {\n color: var(--color-primary);\n background: var(--list-item-selected-bg, color-mix(in oklch, var(--color-primary) 10%, transparent));\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: 0.6;\n }\n\n /* ========================================\n Swipe Action Panels\n ======================================== */\n\n .actions {\n position: absolute;\n inset-block: 0;\n display: flex;\n align-items: stretch;\n width: var(--_actions-width);\n transition: var(--_motion-transition, transform var(--transition-fast));\n }\n\n /* A single slotted action button fills the whole revealed panel — the common case (one big\n tappable target, e.g. a full-height \"Delete\" button) rather than a small icon-sized hit area.\n This stretches the slotted element's own light-DOM box, which is enough for plain elements\n (a native <button>, an <a>, ...). It is NOT enough on its own for `ore-button`: its visible\n surface is an inner `[part=\"button\"]` with a fixed height from its size preset, independent\n of its own host box size — pass `fullheight` on the `ore-button` itself too (see its own\n `fullheight` prop) to actually fill this panel edge-to-edge. */\n .actions ::slotted(*) {\n flex: 1;\n height: 100%;\n }\n\n .actions-left {\n left: 0;\n transform: translateX(calc((var(--_swipe-x, 0) - 1) * 100%));\n }\n\n .actions-right {\n right: 0;\n transform: translateX(calc((var(--_swipe-x, 0) + 1) * 100%));\n }\n\n /* `:host(:has(...))` (`:has()` as `:host()`'s functional argument) is invalid — `:host()`\n only accepts a compound selector and doesn't accept `:has()` inside it. The plain `:host`\n pseudo-class chained directly with `:has()` (no parentheses) is the valid form. Kept as\n separate rules (not grouped via a comma with the `[revealed]` rules) so a selector list\n doesn't silently drop the whole rule if either half were ever invalid again. */\n :host([revealed='left']) {\n --_swipe-x: 1;\n }\n\n :host([revealed='right']) {\n --_swipe-x: -1;\n }\n\n :host:has(.actions-left:focus-within) {\n --_swipe-x: 1;\n }\n\n :host:has(.actions-right:focus-within) {\n --_swipe-x: -1;\n }\n\n /* Suppress the transition while a drag is actively updating `--_swipe-x` inline so the row\n and action panels track the pointer 1:1 instead of lagging behind on every move event. */\n :host([data-dragging]) .row,\n :host([data-dragging]) .actions-left,\n :host([data-dragging]) .actions-right {\n transition: none;\n }\n\n /* Feedback that the drag has passed into \"swipe all the way through\" territory (close to\n CONFIRM_THRESHOLD) — set by list-item.ts's onMove once past ~85% of that distance, cleared\n on release/cancel/commit. Visual-only; the confirm itself fires from JS regardless of CSS. */\n :host([data-confirming]) .actions-left,\n :host([data-confirming]) .actions-right {\n filter: saturate(1.4) brightness(0.94);\n }\n}\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/content/list/list-item.css?inline
|
|
2
|
-
var e = "@layer refine.base{:host{--_actions-width:var(--list-item-actions-width,var(--size-24));color:var(--color-contrast-700);display:block;position:relative;overflow:hidden}.row{z-index:1;box-sizing:border-box;gap:var(--_gap,var(--size-4));width:100%;min-height:var(--_min-height,var(--size-4));padding:var(--_padding,var(--size-2-5) var(--size-4));font-size:var(--_font-size,var(--text-sm));touch-action:pan-y;cursor:default;background:var(--list-item-bg,var(--color-canvas));transform:translateX(calc(var(--_swipe-x,0) * var(--_actions-width)));transition:var(--_motion-transition,transform var(--transition-fast), background var(--transition-fast));border:none;outline:none;align-items:center;display:flex;position:relative}.row:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){text-align:left;padding-right:var(--_padding-inline-end,var(--size-6))}.row:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){text-align:right;padding-left:var(--_padding-inline-end,var(--size-6))}.leading,.trailing{flex-shrink:0;align-items:center;display:flex}.content{gap:var(--size-0-5);flex-direction:column;flex:1;min-width:0;display:flex}.title{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.description{text-overflow:ellipsis;font-size:var(--text-xs);color:var(--color-contrast-
|
|
2
|
+
var e = "@layer refine.base{:host{--_actions-width:var(--list-item-actions-width,var(--size-24));color:var(--color-contrast-700);display:block;position:relative;overflow:hidden}.row{z-index:1;box-sizing:border-box;gap:var(--_gap,var(--size-4));width:100%;min-height:var(--_min-height,var(--size-4));padding:var(--_padding,var(--size-2-5) var(--size-4));font-size:var(--_font-size,var(--text-sm));touch-action:pan-y;cursor:default;background:var(--list-item-bg,var(--color-canvas));transform:translateX(calc(var(--_swipe-x,0) * var(--_actions-width)));transition:var(--_motion-transition,transform var(--transition-fast), background var(--transition-fast));border:none;outline:none;align-items:center;display:flex;position:relative}.row:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){text-align:left;padding-right:var(--_padding-inline-end,var(--size-6))}.row:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){text-align:right;padding-left:var(--_padding-inline-end,var(--size-6))}:host([data-two-line]) .row{min-height:var(--_min-height-two-line,var(--size-18))}:host([actionable]) .row{cursor:pointer}.leading,.trailing{flex-shrink:0;align-items:center;display:flex}.leading[hidden],.trailing[hidden]{display:none}.content{gap:var(--size-0-5);flex-direction:column;flex:1;min-width:0;display:flex}.title{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.description{text-overflow:ellipsis;font-size:var(--text-xs);color:var(--color-contrast-600);white-space:nowrap;display:block;overflow:hidden}.description:empty{display:none}.row:hover{background:var(--list-item-hover-bg,var(--color-contrast-100))}.row:focus-visible{outline:var(--focus-ring);outline-offset:-2px}:host([selected]) .row{color:var(--color-primary);background:var(--list-item-selected-bg,color-mix(in oklch, var(--color-primary) 10%, transparent))}:host([disabled]){pointer-events:none;opacity:.6}.actions{width:var(--_actions-width);transition:var(--_motion-transition,transform var(--transition-fast));align-items:stretch;display:flex;position:absolute;top:0;bottom:0}.actions ::slotted(*){flex:1;height:100%}.actions-left{transform:translateX(calc((var(--_swipe-x,0) - 1) * 100%));left:0}.actions-right{transform:translateX(calc((var(--_swipe-x,0) + 1) * 100%));right:0}:host([revealed=left]){--_swipe-x:1}:host([revealed=right]){--_swipe-x:-1}:host:has(.actions-left:focus-within){--_swipe-x:1}:host:has(.actions-right:focus-within){--_swipe-x:-1}:host([data-dragging]) .row,:host([data-dragging]) .actions-left,:host([data-dragging]) .actions-right{transition:none}:host([data-confirming]) .actions-left,:host([data-confirming]) .actions-right{filter:saturate(1.4)brightness(.94)}}";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { e as default };
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.css.js","names":[],"sources":["../../../src/content/list/list-item.css?inline"],"sourcesContent":["@layer refine.base {\n /* `--_gap` / `--_padding` / `--_font-size` are intentionally not emitted by any mixin in this\n component's own `styles` array — they're inherited from the parent `ore-list`'s\n `sizeVariantMixin(LIST_SIZE_PRESET)` call the same way `ore-menu-item` inherits\n `--_gap`/`--_font-size` from `ore-menu` (see `LIST_SIZE_PRESET`'s doc comment). The\n `var(..., fallback)` defaults below cover standalone use outside an `ore-list`. */\n :host {\n --_actions-width: var(--list-item-actions-width, var(--size-24));\n position: relative;\n display: block;\n overflow: hidden;\n color: var(--color-contrast-700);\n }\n\n /* ========================================\n Row\n ======================================== */\n\n .row {\n position: relative;\n z-index: 1;\n box-sizing: border-box;\n display: flex;\n gap: var(--_gap, var(--size-4));\n align-items: center;\n width: 100%;\n min-height: var(--_min-height, var(--size-4));\n padding: var(--_padding, var(--size-2-5) var(--size-4));\n padding-inline-end: var(--_padding-inline-end, var(--size-6));\n font-size: var(--_font-size, var(--text-sm));\n text-align: start;\n touch-action: pan-y;\n cursor: default;\n outline: none;\n background: var(--list-item-bg, var(--color-canvas));\n border: none;\n transform: translateX(calc(var(--_swipe-x, 0) * var(--_actions-width)));\n transition: var(--_motion-transition, transform var(--transition-fast), background var(--transition-fast));\n }\n\n .leading,\n .trailing {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n }\n\n .content {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--size-0-5);\n min-width: 0;\n }\n\n .title {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .description {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--text-xs);\n color: var(--color-contrast-
|
|
1
|
+
{"version":3,"file":"list-item.css.js","names":[],"sources":["../../../src/content/list/list-item.css?inline"],"sourcesContent":["@layer refine.base {\n /* `--_gap` / `--_padding` / `--_font-size` are intentionally not emitted by any mixin in this\n component's own `styles` array — they're inherited from the parent `ore-list`'s\n `sizeVariantMixin(LIST_SIZE_PRESET)` call the same way `ore-menu-item` inherits\n `--_gap`/`--_font-size` from `ore-menu` (see `LIST_SIZE_PRESET`'s doc comment). The\n `var(..., fallback)` defaults below cover standalone use outside an `ore-list`. */\n :host {\n --_actions-width: var(--list-item-actions-width, var(--size-24));\n position: relative;\n display: block;\n overflow: hidden;\n color: var(--color-contrast-700);\n }\n\n /* ========================================\n Row\n ======================================== */\n\n .row {\n position: relative;\n z-index: 1;\n box-sizing: border-box;\n display: flex;\n gap: var(--_gap, var(--size-4));\n align-items: center;\n width: 100%;\n min-height: var(--_min-height, var(--size-4));\n padding: var(--_padding, var(--size-2-5) var(--size-4));\n padding-inline-end: var(--_padding-inline-end, var(--size-6));\n font-size: var(--_font-size, var(--text-sm));\n text-align: start;\n touch-action: pan-y;\n cursor: default;\n outline: none;\n background: var(--list-item-bg, var(--color-canvas));\n border: none;\n transform: translateX(calc(var(--_swipe-x, 0) * var(--_actions-width)));\n transition: var(--_motion-transition, transform var(--transition-fast), background var(--transition-fast));\n }\n\n :host([data-two-line]) .row {\n min-height: var(--_min-height-two-line, var(--size-18));\n }\n\n :host([actionable]) .row {\n cursor: pointer;\n }\n\n .leading,\n .trailing {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n }\n\n .leading[hidden],\n .trailing[hidden] {\n display: none;\n }\n\n .content {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--size-0-5);\n min-width: 0;\n }\n\n .title {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .description {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--text-xs);\n color: var(--color-contrast-600);\n white-space: nowrap;\n }\n\n .description:empty {\n display: none;\n }\n\n .row:hover {\n background: var(--list-item-hover-bg, var(--color-contrast-100));\n }\n\n .row:focus-visible {\n outline: var(--focus-ring);\n outline-offset: -2px;\n }\n\n /* ========================================\n Selected / Disabled States\n ======================================== */\n\n :host([selected]) .row {\n color: var(--color-primary);\n background: var(--list-item-selected-bg, color-mix(in oklch, var(--color-primary) 10%, transparent));\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: 0.6;\n }\n\n /* ========================================\n Swipe Action Panels\n ======================================== */\n\n .actions {\n position: absolute;\n inset-block: 0;\n display: flex;\n align-items: stretch;\n width: var(--_actions-width);\n transition: var(--_motion-transition, transform var(--transition-fast));\n }\n\n /* A single slotted action button fills the whole revealed panel — the common case (one big\n tappable target, e.g. a full-height \"Delete\" button) rather than a small icon-sized hit area.\n This stretches the slotted element's own light-DOM box, which is enough for plain elements\n (a native <button>, an <a>, ...). It is NOT enough on its own for `ore-button`: its visible\n surface is an inner `[part=\"button\"]` with a fixed height from its size preset, independent\n of its own host box size — pass `fullheight` on the `ore-button` itself too (see its own\n `fullheight` prop) to actually fill this panel edge-to-edge. */\n .actions ::slotted(*) {\n flex: 1;\n height: 100%;\n }\n\n .actions-left {\n left: 0;\n transform: translateX(calc((var(--_swipe-x, 0) - 1) * 100%));\n }\n\n .actions-right {\n right: 0;\n transform: translateX(calc((var(--_swipe-x, 0) + 1) * 100%));\n }\n\n /* `:host(:has(...))` (`:has()` as `:host()`'s functional argument) is invalid — `:host()`\n only accepts a compound selector and doesn't accept `:has()` inside it. The plain `:host`\n pseudo-class chained directly with `:has()` (no parentheses) is the valid form. Kept as\n separate rules (not grouped via a comma with the `[revealed]` rules) so a selector list\n doesn't silently drop the whole rule if either half were ever invalid again. */\n :host([revealed='left']) {\n --_swipe-x: 1;\n }\n\n :host([revealed='right']) {\n --_swipe-x: -1;\n }\n\n :host:has(.actions-left:focus-within) {\n --_swipe-x: 1;\n }\n\n :host:has(.actions-right:focus-within) {\n --_swipe-x: -1;\n }\n\n /* Suppress the transition while a drag is actively updating `--_swipe-x` inline so the row\n and action panels track the pointer 1:1 instead of lagging behind on every move event. */\n :host([data-dragging]) .row,\n :host([data-dragging]) .actions-left,\n :host([data-dragging]) .actions-right {\n transition: none;\n }\n\n /* Feedback that the drag has passed into \"swipe all the way through\" territory (close to\n CONFIRM_THRESHOLD) — set by list-item.ts's onMove once past ~85% of that distance, cleared\n on release/cancel/commit. Visual-only; the confirm itself fires from JS regardless of CSS. */\n :host([data-confirming]) .actions-left,\n :host([data-confirming]) .actions-right {\n filter: saturate(1.4) brightness(0.94);\n }\n}\n"],"mappings":""}
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
export type ListItemRevealSide = 'left' | 'right';
|
|
3
3
|
/** Events emitted by the list-item component */
|
|
4
4
|
export type OreListItemEvents = {
|
|
5
|
+
/** Emitted when an actionable item is activated by pointer or keyboard. */
|
|
6
|
+
activate: {
|
|
7
|
+
item: HTMLElement;
|
|
8
|
+
value: null | string;
|
|
9
|
+
};
|
|
5
10
|
/** Emitted when the revealed action panel closes (gesture, tap, or programmatic). */
|
|
6
11
|
conceal: {
|
|
7
12
|
item: HTMLElement;
|
|
@@ -32,6 +37,8 @@ export type OreListItemEvents = {
|
|
|
32
37
|
};
|
|
33
38
|
/** List-item component properties */
|
|
34
39
|
export type OreListItemProps = {
|
|
40
|
+
/** Enable pointer and Enter/Space activation with button semantics. */
|
|
41
|
+
actionable?: boolean;
|
|
35
42
|
/** Disable this item — blocks pointer interaction, swipe actions, and selection */
|
|
36
43
|
disabled?: boolean;
|
|
37
44
|
/** Which action panel is revealed: 'left' | 'right' (absent = closed). Settable programmatically. */
|
|
@@ -63,11 +70,13 @@ export type OreListItemProps = {
|
|
|
63
70
|
*
|
|
64
71
|
* @element ore-list-item
|
|
65
72
|
*
|
|
73
|
+
* @attr {boolean} actionable - Enable pointer and Enter/Space activation with button semantics
|
|
66
74
|
* @attr {boolean} disabled - Disable this item
|
|
67
75
|
* @attr {boolean} selected - Read-only reflected attribute: `true` when this item's `value` matches the parent `ore-list`'s `value`. Not independently settable.
|
|
68
76
|
* @attr {string} value - Opaque value compared against the parent list's `value` to derive `selected`; also reported in select/change events
|
|
69
77
|
* @attr {string} revealed - Which action panel is revealed: 'left' | 'right'
|
|
70
78
|
*
|
|
79
|
+
* @fires activate - Actionable item is activated. detail: { item: HTMLElement, value: string | null }
|
|
71
80
|
* @fires select - Item becomes selected. detail: { item: HTMLElement, value: string | null }
|
|
72
81
|
* @fires deselect - Item becomes deselected. detail: { item: HTMLElement, value: string | null }
|
|
73
82
|
* @fires reveal - An action panel opens. detail: { item: HTMLElement, side: 'left' | 'right' }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.d.ts","sourceRoot":"","sources":["../../../src/content/list/list-item.ts"],"names":[],"mappings":"AAqBA,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD,gDAAgD;AAChD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,qFAAqF;IACrF,OAAO,EAAE;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC;IAC/B;;;OAGG;IACH,OAAO,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACzD,gDAAgD;IAChD,QAAQ,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,CAAC;IACtD,0DAA0D;IAC1D,MAAM,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACxD,iGAAiG;IACjG,MAAM,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,CAAC;CACrD,CAAC;AAEF,qCAAqC;AACrC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mFAAmF;IACnF,QAAQ,CAAC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KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAMF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,eAAO,MAAM,aAAa,EAAG,eAAwB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=`@layer refine.base{:host{--_bg:var(--stats-bg,var(--color-canvas));--_color:var(--stats-color,var(--color-contrast-900));--_border-color:var(--stats-border-color,var(--color-divider));--_radius:var(--stats-radius,var(--rounded-lg));--_padding:var(--stats-padding,var(--size-4));--_min-height:var(--stats-min-height,var(--size-32));--_value-size:var(--stats-value-size,var(--text-2xl));--_icon-size:var(--size-9);--_gap:var(--size-3);min-width:0;display:block}.stats{box-sizing:border-box;gap:var(--_gap);width:100%;min-width:0;min-height:var(--_min-height);padding:var(--_padding);color:var(--_color);background:var(--_bg);border:var(--border) solid var(--_border-color);border-radius:var(--_radius);flex-direction:column;display:flex;position:relative;overflow:hidden}.header,.body,.footer{min-width:0;display:flex}.header{gap:var(--size-2);align-items:center}.icon{flex:0 0 var(--_icon-size);width:var(--_icon-size);height:var(--_icon-size);color:var(--_theme-base,var(--color-primary));background:var(--stats-icon-bg,var(--_theme-backdrop,var(--color-contrast-100)));border-radius:var(--rounded-md);place-items:center;display:grid}.label,.description,.trend{text-overflow:ellipsis;font-size:var(--text-xs);white-space:nowrap;overflow:hidden}.label{font-weight:var(--font-semibold);color:var(--color-contrast-700)}.body{gap:var(--size-3);flex:1;justify-content:space-between;align-items:end}.value{text-overflow:ellipsis;min-width:0;font-size:var(--_value-size);font-variant-numeric:tabular-nums;line-height:var(--leading-tight);color:inherit;letter-spacing:-.03em;white-space:nowrap;overflow:hidden}.visual{flex:0 45%;justify-content:end;align-items:end;min-width:50%;display:flex;position:absolute;bottom:0;right:0}.footer{gap:var(--size-1);align-items:center}.trend{font-weight:var(--font-semibold);color:var(--color-contrast-700);flex-shrink:0}.trend[data-direction=up]{color:var(--stats-trend-up,var(--color-success))}.trend[data-direction=down]{color:var(--stats-trend-down,var(--color-error))}.description{min-width:0;color:var(--color-contrast-700)}.loading{z-index:2;pointer-events:none;background:linear-gradient(100deg, color-mix(in oklch, var(--_bg) 88%, var(--color-contrast-200)) 20%, color-mix(in oklch, var(--_bg) 72%, var(--color-contrast-200)) 45%, color-mix(in oklch, var(--_bg) 88%, var(--color-contrast-200)) 70%);background-size:220% 100%;display:none;position:absolute;inset:0}[hidden]{display:none}}@layer refine.variants{:host([variant=plain]) .stats{background:var(--stats-bg,transparent);border:0;border-radius:0;min-height:0}:host([variant=solid]){--_bg:var(--stats-bg,var(--_theme-base));--_color:var(--stats-color,var(--_theme-contrast));--_border-color:var(--stats-border-color,var(--_theme-base))}:host([variant=solid]) .label,:host([variant=solid]) .description,:host([variant=solid]) .trend{color:color-mix(in oklch, var(--_color) 78%, transparent)}}@layer refine.overrides{:host([loading]) .loading{animation:var(--_motion-animation,stats-loading 1.4s linear infinite);display:block}:host([loading]) .header,:host([loading]) .body,:host([loading]) .footer{visibility:hidden}:host([disabled]){pointer-events:none;opacity:.55;filter:grayscale(.35)}}@keyframes stats-loading{0%{background-position:100% 0}to{background-position:-120% 0}}`;exports.default=e;
|
|
2
|
+
//# sourceMappingURL=stats.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.css.cjs","names":[],"sources":["../../../src/content/stats/stats.css?inline"],"sourcesContent":["@layer refine.base {\n :host {\n --_bg: var(--stats-bg, var(--color-canvas));\n --_color: var(--stats-color, var(--color-contrast-900));\n --_border-color: var(--stats-border-color, var(--color-divider));\n --_radius: var(--stats-radius, var(--rounded-lg));\n --_padding: var(--stats-padding, var(--size-4));\n --_min-height: var(--stats-min-height, var(--size-32));\n --_value-size: var(--stats-value-size, var(--text-2xl));\n --_icon-size: var(--size-9);\n --_gap: var(--size-3);\n\n display: block;\n min-width: 0;\n }\n\n .stats {\n position: relative;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: var(--_gap);\n width: 100%;\n min-width: 0;\n min-height: var(--_min-height);\n padding: var(--_padding);\n overflow: hidden;\n color: var(--_color);\n background: var(--_bg);\n border: var(--border) solid var(--_border-color);\n border-radius: var(--_radius);\n }\n\n .header,\n .body,\n .footer {\n display: flex;\n min-width: 0;\n }\n\n .header {\n gap: var(--size-2);\n align-items: center;\n }\n\n .icon {\n display: grid;\n flex: 0 0 var(--_icon-size);\n place-items: center;\n width: var(--_icon-size);\n height: var(--_icon-size);\n color: var(--_theme-base, var(--color-primary));\n background: var(--stats-icon-bg, var(--_theme-backdrop, var(--color-contrast-100)));\n border-radius: var(--rounded-md);\n }\n\n .label,\n .description,\n .trend {\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--text-xs);\n white-space: nowrap;\n }\n\n .label {\n font-weight: var(--font-semibold);\n color: var(--color-contrast-700);\n }\n\n .body {\n flex: 1;\n gap: var(--size-3);\n align-items: end;\n justify-content: space-between;\n }\n\n .value {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--_value-size);\n font-variant-numeric: tabular-nums;\n line-height: var(--leading-tight);\n color: inherit;\n letter-spacing: -0.03em;\n white-space: nowrap;\n }\n\n .visual {\n position: absolute;\n right: 0;\n bottom: 0;\n display: flex;\n flex: 0 1 45%;\n align-items: end;\n justify-content: end;\n min-width: 50%;\n }\n\n .footer {\n gap: var(--size-1);\n align-items: center;\n }\n\n .trend {\n flex-shrink: 0;\n font-weight: var(--font-semibold);\n color: var(--color-contrast-700);\n }\n\n .trend[data-direction='up'] {\n color: var(--stats-trend-up, var(--color-success));\n }\n\n .trend[data-direction='down'] {\n color: var(--stats-trend-down, var(--color-error));\n }\n\n .description {\n min-width: 0;\n color: var(--color-contrast-700);\n }\n\n .loading {\n position: absolute;\n inset: 0;\n z-index: 2;\n display: none;\n pointer-events: none;\n background: linear-gradient(\n 100deg,\n color-mix(in oklch, var(--_bg) 88%, var(--color-contrast-200)) 20%,\n color-mix(in oklch, var(--_bg) 72%, var(--color-contrast-200)) 45%,\n color-mix(in oklch, var(--_bg) 88%, var(--color-contrast-200)) 70%\n );\n background-size: 220% 100%;\n }\n\n [hidden] {\n display: none;\n }\n}\n\n@layer refine.variants {\n :host([variant='plain']) .stats {\n min-height: 0;\n background: var(--stats-bg, transparent);\n border: 0;\n border-radius: 0;\n }\n\n :host([variant='solid']) {\n --_bg: var(--stats-bg, var(--_theme-base));\n --_color: var(--stats-color, var(--_theme-contrast));\n --_border-color: var(--stats-border-color, var(--_theme-base));\n }\n\n :host([variant='solid']) .label,\n :host([variant='solid']) .description,\n :host([variant='solid']) .trend {\n color: color-mix(in oklch, var(--_color) 78%, transparent);\n }\n}\n\n@layer refine.overrides {\n :host([loading]) .loading {\n display: block;\n animation: var(--_motion-animation, stats-loading 1.4s linear infinite);\n }\n\n :host([loading]) .header,\n :host([loading]) .body,\n :host([loading]) .footer {\n visibility: hidden;\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: 0.55;\n filter: grayscale(0.35);\n }\n}\n\n@keyframes stats-loading {\n from {\n background-position: 100% 0;\n }\n\n to {\n background-position: -120% 0;\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/content/stats/stats.css?inline
|
|
2
|
+
var e = "@layer refine.base{:host{--_bg:var(--stats-bg,var(--color-canvas));--_color:var(--stats-color,var(--color-contrast-900));--_border-color:var(--stats-border-color,var(--color-divider));--_radius:var(--stats-radius,var(--rounded-lg));--_padding:var(--stats-padding,var(--size-4));--_min-height:var(--stats-min-height,var(--size-32));--_value-size:var(--stats-value-size,var(--text-2xl));--_icon-size:var(--size-9);--_gap:var(--size-3);min-width:0;display:block}.stats{box-sizing:border-box;gap:var(--_gap);width:100%;min-width:0;min-height:var(--_min-height);padding:var(--_padding);color:var(--_color);background:var(--_bg);border:var(--border) solid var(--_border-color);border-radius:var(--_radius);flex-direction:column;display:flex;position:relative;overflow:hidden}.header,.body,.footer{min-width:0;display:flex}.header{gap:var(--size-2);align-items:center}.icon{flex:0 0 var(--_icon-size);width:var(--_icon-size);height:var(--_icon-size);color:var(--_theme-base,var(--color-primary));background:var(--stats-icon-bg,var(--_theme-backdrop,var(--color-contrast-100)));border-radius:var(--rounded-md);place-items:center;display:grid}.label,.description,.trend{text-overflow:ellipsis;font-size:var(--text-xs);white-space:nowrap;overflow:hidden}.label{font-weight:var(--font-semibold);color:var(--color-contrast-700)}.body{gap:var(--size-3);flex:1;justify-content:space-between;align-items:end}.value{text-overflow:ellipsis;min-width:0;font-size:var(--_value-size);font-variant-numeric:tabular-nums;line-height:var(--leading-tight);color:inherit;letter-spacing:-.03em;white-space:nowrap;overflow:hidden}.visual{flex:0 45%;justify-content:end;align-items:end;min-width:50%;display:flex;position:absolute;bottom:0;right:0}.footer{gap:var(--size-1);align-items:center}.trend{font-weight:var(--font-semibold);color:var(--color-contrast-700);flex-shrink:0}.trend[data-direction=up]{color:var(--stats-trend-up,var(--color-success))}.trend[data-direction=down]{color:var(--stats-trend-down,var(--color-error))}.description{min-width:0;color:var(--color-contrast-700)}.loading{z-index:2;pointer-events:none;background:linear-gradient(100deg, color-mix(in oklch, var(--_bg) 88%, var(--color-contrast-200)) 20%, color-mix(in oklch, var(--_bg) 72%, var(--color-contrast-200)) 45%, color-mix(in oklch, var(--_bg) 88%, var(--color-contrast-200)) 70%);background-size:220% 100%;display:none;position:absolute;inset:0}[hidden]{display:none}}@layer refine.variants{:host([variant=plain]) .stats{background:var(--stats-bg,transparent);border:0;border-radius:0;min-height:0}:host([variant=solid]){--_bg:var(--stats-bg,var(--_theme-base));--_color:var(--stats-color,var(--_theme-contrast));--_border-color:var(--stats-border-color,var(--_theme-base))}:host([variant=solid]) .label,:host([variant=solid]) .description,:host([variant=solid]) .trend{color:color-mix(in oklch, var(--_color) 78%, transparent)}}@layer refine.overrides{:host([loading]) .loading{animation:var(--_motion-animation,stats-loading 1.4s linear infinite);display:block}:host([loading]) .header,:host([loading]) .body,:host([loading]) .footer{visibility:hidden}:host([disabled]){pointer-events:none;opacity:.55;filter:grayscale(.35)}}@keyframes stats-loading{0%{background-position:100% 0}to{background-position:-120% 0}}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=stats.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.css.js","names":[],"sources":["../../../src/content/stats/stats.css?inline"],"sourcesContent":["@layer refine.base {\n :host {\n --_bg: var(--stats-bg, var(--color-canvas));\n --_color: var(--stats-color, var(--color-contrast-900));\n --_border-color: var(--stats-border-color, var(--color-divider));\n --_radius: var(--stats-radius, var(--rounded-lg));\n --_padding: var(--stats-padding, var(--size-4));\n --_min-height: var(--stats-min-height, var(--size-32));\n --_value-size: var(--stats-value-size, var(--text-2xl));\n --_icon-size: var(--size-9);\n --_gap: var(--size-3);\n\n display: block;\n min-width: 0;\n }\n\n .stats {\n position: relative;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: var(--_gap);\n width: 100%;\n min-width: 0;\n min-height: var(--_min-height);\n padding: var(--_padding);\n overflow: hidden;\n color: var(--_color);\n background: var(--_bg);\n border: var(--border) solid var(--_border-color);\n border-radius: var(--_radius);\n }\n\n .header,\n .body,\n .footer {\n display: flex;\n min-width: 0;\n }\n\n .header {\n gap: var(--size-2);\n align-items: center;\n }\n\n .icon {\n display: grid;\n flex: 0 0 var(--_icon-size);\n place-items: center;\n width: var(--_icon-size);\n height: var(--_icon-size);\n color: var(--_theme-base, var(--color-primary));\n background: var(--stats-icon-bg, var(--_theme-backdrop, var(--color-contrast-100)));\n border-radius: var(--rounded-md);\n }\n\n .label,\n .description,\n .trend {\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--text-xs);\n white-space: nowrap;\n }\n\n .label {\n font-weight: var(--font-semibold);\n color: var(--color-contrast-700);\n }\n\n .body {\n flex: 1;\n gap: var(--size-3);\n align-items: end;\n justify-content: space-between;\n }\n\n .value {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--_value-size);\n font-variant-numeric: tabular-nums;\n line-height: var(--leading-tight);\n color: inherit;\n letter-spacing: -0.03em;\n white-space: nowrap;\n }\n\n .visual {\n position: absolute;\n right: 0;\n bottom: 0;\n display: flex;\n flex: 0 1 45%;\n align-items: end;\n justify-content: end;\n min-width: 50%;\n }\n\n .footer {\n gap: var(--size-1);\n align-items: center;\n }\n\n .trend {\n flex-shrink: 0;\n font-weight: var(--font-semibold);\n color: var(--color-contrast-700);\n }\n\n .trend[data-direction='up'] {\n color: var(--stats-trend-up, var(--color-success));\n }\n\n .trend[data-direction='down'] {\n color: var(--stats-trend-down, var(--color-error));\n }\n\n .description {\n min-width: 0;\n color: var(--color-contrast-700);\n }\n\n .loading {\n position: absolute;\n inset: 0;\n z-index: 2;\n display: none;\n pointer-events: none;\n background: linear-gradient(\n 100deg,\n color-mix(in oklch, var(--_bg) 88%, var(--color-contrast-200)) 20%,\n color-mix(in oklch, var(--_bg) 72%, var(--color-contrast-200)) 45%,\n color-mix(in oklch, var(--_bg) 88%, var(--color-contrast-200)) 70%\n );\n background-size: 220% 100%;\n }\n\n [hidden] {\n display: none;\n }\n}\n\n@layer refine.variants {\n :host([variant='plain']) .stats {\n min-height: 0;\n background: var(--stats-bg, transparent);\n border: 0;\n border-radius: 0;\n }\n\n :host([variant='solid']) {\n --_bg: var(--stats-bg, var(--_theme-base));\n --_color: var(--stats-color, var(--_theme-contrast));\n --_border-color: var(--stats-border-color, var(--_theme-base));\n }\n\n :host([variant='solid']) .label,\n :host([variant='solid']) .description,\n :host([variant='solid']) .trend {\n color: color-mix(in oklch, var(--_color) 78%, transparent);\n }\n}\n\n@layer refine.overrides {\n :host([loading]) .loading {\n display: block;\n animation: var(--_motion-animation, stats-loading 1.4s linear infinite);\n }\n\n :host([loading]) .header,\n :host([loading]) .body,\n :host([loading]) .footer {\n visibility: hidden;\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: 0.55;\n filter: grayscale(0.35);\n }\n}\n\n@keyframes stats-loading {\n from {\n background-position: 100% 0;\n }\n\n to {\n background-position: -120% 0;\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ComponentSize, RoundedSize, ThemeColor } from '../../types';
|
|
2
|
+
export type StatsTrendDirection = 'down' | 'neutral' | 'up';
|
|
3
|
+
export type StatsVariant = 'outlined' | 'plain' | 'solid';
|
|
4
|
+
export type OreStatsProps = {
|
|
5
|
+
color?: ThemeColor;
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
label?: string;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
rounded?: RoundedSize;
|
|
11
|
+
size?: ComponentSize;
|
|
12
|
+
trend?: string;
|
|
13
|
+
'trend-direction'?: StatsTrendDirection;
|
|
14
|
+
value?: string;
|
|
15
|
+
variant?: StatsVariant;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A focused metric card for a label, primary value, supporting context, trend, icon, and optional visual.
|
|
19
|
+
*
|
|
20
|
+
* @element ore-stats
|
|
21
|
+
*
|
|
22
|
+
* @attr {string} label - Metric label
|
|
23
|
+
* @attr {string} value - Primary metric value
|
|
24
|
+
* @attr {string} description - Supporting context
|
|
25
|
+
* @attr {string} trend - Trend text
|
|
26
|
+
* @attr {string} trend-direction - Trend direction: 'up' | 'down' | 'neutral'
|
|
27
|
+
* @attr {string} variant - Visual variant: 'outlined' | 'plain' | 'solid'
|
|
28
|
+
* @attr {string} color - Semantic theme color
|
|
29
|
+
* @attr {string} size - Size: 'sm' | 'md' | 'lg'
|
|
30
|
+
* @attr {string} rounded - Border radius size
|
|
31
|
+
* @attr {boolean} loading - Show loading state
|
|
32
|
+
* @attr {boolean} disabled - Show unavailable state
|
|
33
|
+
*
|
|
34
|
+
* @slot icon - Leading metric icon
|
|
35
|
+
* @slot label - Replaces label text
|
|
36
|
+
* @slot value - Replaces value text
|
|
37
|
+
* @slot visual - Compact chart, progress, or other metric visual
|
|
38
|
+
* @slot trend - Replaces trend text
|
|
39
|
+
* @slot description - Replaces supporting context
|
|
40
|
+
*
|
|
41
|
+
* @cssprop --stats-bg - Card background
|
|
42
|
+
* @cssprop --stats-color - Card foreground color
|
|
43
|
+
* @cssprop --stats-border-color - Card border color
|
|
44
|
+
* @cssprop --stats-radius - Card border radius
|
|
45
|
+
* @cssprop --stats-padding - Card padding
|
|
46
|
+
* @cssprop --stats-min-height - Minimum card height
|
|
47
|
+
* @cssprop --stats-value-size - Primary value font size
|
|
48
|
+
* @cssprop --stats-icon-bg - Icon surface background
|
|
49
|
+
* @cssprop --stats-trend-up - Positive trend color
|
|
50
|
+
* @cssprop --stats-trend-down - Negative trend color
|
|
51
|
+
*
|
|
52
|
+
* @part card - Card surface
|
|
53
|
+
* @part loading - Loading indicator
|
|
54
|
+
* @part header - Label and icon row
|
|
55
|
+
* @part icon - Icon container
|
|
56
|
+
* @part label - Label container
|
|
57
|
+
* @part body - Value and visual row
|
|
58
|
+
* @part value - Primary value container
|
|
59
|
+
* @part visual - Visual slot container
|
|
60
|
+
* @part footer - Trend and description row
|
|
61
|
+
* @part trend - Trend container
|
|
62
|
+
* @part description - Description container
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```html
|
|
66
|
+
* <ore-stats label="Revenue" value="$42,800" trend="+12%" trend-direction="up">
|
|
67
|
+
* <ore-icon slot="icon" name="chart-line"></ore-icon>
|
|
68
|
+
* </ore-stats>
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare const STATS_TAG: "ore-stats";
|
|
72
|
+
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/content/stats/stats.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG1E,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAC5D,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1D,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,mBAAmB,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,SAAS,EAAG,WAAoB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=(e={})=>{let t=null,n=()=>{
|
|
1
|
+
var e=(e={})=>{let t=null,n=()=>{t&&e.enabled?.value!==!1&&(t.style.height=`auto`,t.style.height=`${t.scrollHeight}px`)};return{recompute:n,wire:e=>(t=e,e.addEventListener(`input`,n),requestAnimationFrame(n),()=>{e.removeEventListener(`input`,n),t===e&&(t=null)})}};exports.createAutoResize=e;
|
|
2
2
|
//# sourceMappingURL=auto-resize.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-resize.cjs","names":[],"sources":["../../src/core/auto-resize.ts"],"sourcesContent":["import type { Readable } from '@vielzeug/ripple';\n\nexport type AutoResizeOptions = {\n /** Gates growth; omit for an always-on composer field, or pass a signal for a toggleable `auto-resize` attribute. */\n enabled?: Readable<boolean | undefined>;\n};\n\nexport type AutoResizeControl = {\n /** Recomputes height from the wired element's current content. No-ops when `enabled` is false or nothing is wired. */\n recompute: () => void;\n /** Wire onto the raw `<textarea>` when it mounts. Returns a detach function to call on unmount. */\n wire: (el: HTMLTextAreaElement) => () => void;\n};\n\n/**\n * Grows a `<textarea>`'s height to fit its content, shared by every component that offers\n * auto-resize (`ore-textarea`, `ore-message-composer`) instead of each reimplementing it.\n *\n * Owns only height — manual-resize cursor/direction is a per-component styling concern, not\n * shared behavior, so it stays local to whichever component renders a resize handle.\n *\n * @example\n * ```ts\n * const autoResize = createAutoResize({ enabled: props['auto-resize'] });\n *\n * onElement(textareaRef, (el) => autoResize.wire(el));\n * // after a programmatic value change that doesn't fire a native `input` event:\n * autoResize.recompute();\n * ```\n */\nexport const createAutoResize = (options: AutoResizeOptions = {}): AutoResizeControl => {\n let wiredEl: HTMLTextAreaElement | null = null;\n\n const recompute = (): void => {\n if (!wiredEl || options.enabled?.value === false) return;\n\n wiredEl.style.height = 'auto';\n wiredEl.style.height = `${wiredEl.scrollHeight}px`;\n };\n\n const wire = (el: HTMLTextAreaElement): (() => void) => {\n wiredEl = el;\n el.addEventListener('input', recompute);\n\n // Deferred a frame: right after mount, the browser hasn't necessarily finished laying out\n // the textarea yet, so a synchronous `scrollHeight` read here can be stale — often reading\n // as 0 and collapsing the field until the next real `input` event happens to correct it.\n // `ore-textarea` has always worked around this locally with its own extra `requestAnimationFrame`\n // call; folding the deferral into `wire()` itself means every consumer gets it for free.\n requestAnimationFrame(recompute);\n\n return () => {\n el.removeEventListener('input', recompute);\n\n if (wiredEl === el) wiredEl = null;\n };\n };\n\n return { recompute, wire };\n};\n"],"mappings":"AA8BA,IAAa,GAAoB,EAA6B,CAAC,IAAyB,CACtF,IAAI,EAAsC,KAEpC,MAAwB,
|
|
1
|
+
{"version":3,"file":"auto-resize.cjs","names":[],"sources":["../../src/core/auto-resize.ts"],"sourcesContent":["import type { Readable } from '@vielzeug/ripple';\n\nexport type AutoResizeOptions = {\n /** Gates growth; omit for an always-on composer field, or pass a signal for a toggleable `auto-resize` attribute. */\n enabled?: Readable<boolean | undefined>;\n};\n\nexport type AutoResizeControl = {\n /** Recomputes height from the wired element's current content. No-ops when `enabled` is false or nothing is wired. */\n recompute: () => void;\n /** Wire onto the raw `<textarea>` when it mounts. Returns a detach function to call on unmount. */\n wire: (el: HTMLTextAreaElement) => () => void;\n};\n\n/**\n * Grows a `<textarea>`'s height to fit its content, shared by every component that offers\n * auto-resize (`ore-textarea`, `ore-message-composer`) instead of each reimplementing it.\n *\n * Owns only height — manual-resize cursor/direction is a per-component styling concern, not\n * shared behavior, so it stays local to whichever component renders a resize handle.\n *\n * @example\n * ```ts\n * const autoResize = createAutoResize({ enabled: props['auto-resize'] });\n *\n * onElement(textareaRef, (el) => autoResize.wire(el));\n * // after a programmatic value change that doesn't fire a native `input` event:\n * autoResize.recompute();\n * ```\n */\nexport const createAutoResize = (options: AutoResizeOptions = {}): AutoResizeControl => {\n let wiredEl: HTMLTextAreaElement | null = null;\n\n const recompute = (): void => {\n if (!wiredEl || options.enabled?.value === false) return;\n\n wiredEl.style.height = 'auto';\n wiredEl.style.height = `${wiredEl.scrollHeight}px`;\n };\n\n const wire = (el: HTMLTextAreaElement): (() => void) => {\n wiredEl = el;\n el.addEventListener('input', recompute);\n\n // Deferred a frame: right after mount, the browser hasn't necessarily finished laying out\n // the textarea yet, so a synchronous `scrollHeight` read here can be stale — often reading\n // as 0 and collapsing the field until the next real `input` event happens to correct it.\n // `ore-textarea` has always worked around this locally with its own extra `requestAnimationFrame`\n // call; folding the deferral into `wire()` itself means every consumer gets it for free.\n requestAnimationFrame(recompute);\n\n return () => {\n el.removeEventListener('input', recompute);\n\n if (wiredEl === el) wiredEl = null;\n };\n };\n\n return { recompute, wire };\n};\n"],"mappings":"AA8BA,IAAa,GAAoB,EAA6B,CAAC,IAAyB,CACtF,IAAI,EAAsC,KAEpC,MAAwB,CACvB,GAAW,EAAQ,SAAS,QAAU,KAE3C,EAAQ,MAAM,OAAS,OACvB,EAAQ,MAAM,OAAS,GAAG,EAAQ,aAAa,IACjD,EAoBA,MAAO,CAAE,YAAW,KAlBN,IACZ,EAAU,EACV,EAAG,iBAAiB,QAAS,CAAS,EAOtC,sBAAsB,CAAS,MAElB,CACX,EAAG,oBAAoB,QAAS,CAAS,EAErC,IAAY,IAAI,EAAU,KAChC,EAGuB,CAC3B"}
|
package/dist/core/auto-resize.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/core/auto-resize.ts
|
|
2
2
|
var e = (e = {}) => {
|
|
3
3
|
let t = null, n = () => {
|
|
4
|
-
|
|
4
|
+
t && e.enabled?.value !== !1 && (t.style.height = "auto", t.style.height = `${t.scrollHeight}px`);
|
|
5
5
|
};
|
|
6
6
|
return {
|
|
7
7
|
recompute: n,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-resize.js","names":[],"sources":["../../src/core/auto-resize.ts"],"sourcesContent":["import type { Readable } from '@vielzeug/ripple';\n\nexport type AutoResizeOptions = {\n /** Gates growth; omit for an always-on composer field, or pass a signal for a toggleable `auto-resize` attribute. */\n enabled?: Readable<boolean | undefined>;\n};\n\nexport type AutoResizeControl = {\n /** Recomputes height from the wired element's current content. No-ops when `enabled` is false or nothing is wired. */\n recompute: () => void;\n /** Wire onto the raw `<textarea>` when it mounts. Returns a detach function to call on unmount. */\n wire: (el: HTMLTextAreaElement) => () => void;\n};\n\n/**\n * Grows a `<textarea>`'s height to fit its content, shared by every component that offers\n * auto-resize (`ore-textarea`, `ore-message-composer`) instead of each reimplementing it.\n *\n * Owns only height — manual-resize cursor/direction is a per-component styling concern, not\n * shared behavior, so it stays local to whichever component renders a resize handle.\n *\n * @example\n * ```ts\n * const autoResize = createAutoResize({ enabled: props['auto-resize'] });\n *\n * onElement(textareaRef, (el) => autoResize.wire(el));\n * // after a programmatic value change that doesn't fire a native `input` event:\n * autoResize.recompute();\n * ```\n */\nexport const createAutoResize = (options: AutoResizeOptions = {}): AutoResizeControl => {\n let wiredEl: HTMLTextAreaElement | null = null;\n\n const recompute = (): void => {\n if (!wiredEl || options.enabled?.value === false) return;\n\n wiredEl.style.height = 'auto';\n wiredEl.style.height = `${wiredEl.scrollHeight}px`;\n };\n\n const wire = (el: HTMLTextAreaElement): (() => void) => {\n wiredEl = el;\n el.addEventListener('input', recompute);\n\n // Deferred a frame: right after mount, the browser hasn't necessarily finished laying out\n // the textarea yet, so a synchronous `scrollHeight` read here can be stale — often reading\n // as 0 and collapsing the field until the next real `input` event happens to correct it.\n // `ore-textarea` has always worked around this locally with its own extra `requestAnimationFrame`\n // call; folding the deferral into `wire()` itself means every consumer gets it for free.\n requestAnimationFrame(recompute);\n\n return () => {\n el.removeEventListener('input', recompute);\n\n if (wiredEl === el) wiredEl = null;\n };\n };\n\n return { recompute, wire };\n};\n"],"mappings":";AA8BA,IAAa,KAAoB,IAA6B,CAAC,MAAyB;CACtF,IAAI,IAAsC,MAEpC,UAAwB;EACxB,
|
|
1
|
+
{"version":3,"file":"auto-resize.js","names":[],"sources":["../../src/core/auto-resize.ts"],"sourcesContent":["import type { Readable } from '@vielzeug/ripple';\n\nexport type AutoResizeOptions = {\n /** Gates growth; omit for an always-on composer field, or pass a signal for a toggleable `auto-resize` attribute. */\n enabled?: Readable<boolean | undefined>;\n};\n\nexport type AutoResizeControl = {\n /** Recomputes height from the wired element's current content. No-ops when `enabled` is false or nothing is wired. */\n recompute: () => void;\n /** Wire onto the raw `<textarea>` when it mounts. Returns a detach function to call on unmount. */\n wire: (el: HTMLTextAreaElement) => () => void;\n};\n\n/**\n * Grows a `<textarea>`'s height to fit its content, shared by every component that offers\n * auto-resize (`ore-textarea`, `ore-message-composer`) instead of each reimplementing it.\n *\n * Owns only height — manual-resize cursor/direction is a per-component styling concern, not\n * shared behavior, so it stays local to whichever component renders a resize handle.\n *\n * @example\n * ```ts\n * const autoResize = createAutoResize({ enabled: props['auto-resize'] });\n *\n * onElement(textareaRef, (el) => autoResize.wire(el));\n * // after a programmatic value change that doesn't fire a native `input` event:\n * autoResize.recompute();\n * ```\n */\nexport const createAutoResize = (options: AutoResizeOptions = {}): AutoResizeControl => {\n let wiredEl: HTMLTextAreaElement | null = null;\n\n const recompute = (): void => {\n if (!wiredEl || options.enabled?.value === false) return;\n\n wiredEl.style.height = 'auto';\n wiredEl.style.height = `${wiredEl.scrollHeight}px`;\n };\n\n const wire = (el: HTMLTextAreaElement): (() => void) => {\n wiredEl = el;\n el.addEventListener('input', recompute);\n\n // Deferred a frame: right after mount, the browser hasn't necessarily finished laying out\n // the textarea yet, so a synchronous `scrollHeight` read here can be stale — often reading\n // as 0 and collapsing the field until the next real `input` event happens to correct it.\n // `ore-textarea` has always worked around this locally with its own extra `requestAnimationFrame`\n // call; folding the deferral into `wire()` itself means every consumer gets it for free.\n requestAnimationFrame(recompute);\n\n return () => {\n el.removeEventListener('input', recompute);\n\n if (wiredEl === el) wiredEl = null;\n };\n };\n\n return { recompute, wire };\n};\n"],"mappings":";AA8BA,IAAa,KAAoB,IAA6B,CAAC,MAAyB;CACtF,IAAI,IAAsC,MAEpC,UAAwB;EACxB,AAAC,KAAW,EAAQ,SAAS,UAAU,OAE3C,EAAQ,MAAM,SAAS,QACvB,EAAQ,MAAM,SAAS,GAAG,EAAQ,aAAa;CACjD;CAoBA,OAAO;EAAE;EAAW,OAlBN,OACZ,IAAU,GACV,EAAG,iBAAiB,SAAS,CAAS,GAOtC,sBAAsB,CAAS,SAElB;GAGX,AAFA,EAAG,oBAAoB,SAAS,CAAS,GAErC,MAAY,MAAI,IAAU;EAChC;CAGuB;AAC3B"}
|