@nvidia-elements/core 0.0.8 → 0.0.10
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/CHANGELOG.md +15 -0
- package/dist/accordion/accordion2.js +4 -4
- package/dist/alert/alert-group2.js +1 -1
- package/dist/alert/alert2.js +1 -1
- package/dist/avatar/avatar-group2.js +1 -1
- package/dist/avatar/avatar2.js +1 -1
- package/dist/badge/badge.js +1 -1
- package/dist/badge/badge.js.map +1 -1
- package/dist/badge/badge2.js +1 -1
- package/dist/breadcrumb/breadcrumb.js +1 -1
- package/dist/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/breadcrumb/breadcrumb2.js +1 -1
- package/dist/bundles/index.d.ts +3 -2
- package/dist/bundles/index.js +2 -2
- package/dist/button/button2.js +1 -1
- package/dist/button-group/button-group2.js +1 -1
- package/dist/card/card-content.js +1 -1
- package/dist/card/card-content.js.map +1 -1
- package/dist/card/card-header.js +1 -1
- package/dist/card/card-header.js.map +1 -1
- package/dist/card/card2.js +4 -4
- package/dist/chat-message/chat-message2.js +1 -1
- package/dist/checkbox/checkbox-group2.js +1 -1
- package/dist/checkbox/checkbox2.js +1 -1
- package/dist/color/color2.js +1 -1
- package/dist/combobox/combobox.examples.js.map +1 -1
- package/dist/combobox/combobox2.js +1 -1
- package/dist/copy-button/copy-button2.js +1 -1
- package/dist/copy-button/copy-button2.js.map +1 -1
- package/dist/custom-elements-jsx.d.ts +4 -2
- package/dist/custom-elements-vue.d.ts +4 -2
- package/dist/custom-elements.json +28 -12
- package/dist/data.html.json +6 -4
- package/dist/date/date2.js +1 -1
- package/dist/datetime/datetime2.js +1 -1
- package/dist/dialog/dialog-footer2.js +1 -1
- package/dist/dialog/dialog-header2.js +1 -1
- package/dist/dialog/dialog2.js +1 -1
- package/dist/divider/divider2.js +1 -1
- package/dist/dot/dot2.js +1 -1
- package/dist/drawer/drawer-content2.js +1 -1
- package/dist/drawer/drawer-footer2.js +1 -1
- package/dist/drawer/drawer-header2.js +1 -1
- package/dist/drawer/drawer2.js +1 -1
- package/dist/dropdown/dropdown-footer2.js +1 -1
- package/dist/dropdown/dropdown-header2.js +1 -1
- package/dist/dropdown/dropdown2.js +1 -1
- package/dist/dropdown-group/dropdown-group.js +1 -1
- package/dist/dropdown-group/dropdown-group.js.map +1 -1
- package/dist/dropzone/dropzone.util.js +4 -1
- package/dist/dropzone/dropzone.util.js.map +1 -1
- package/dist/dropzone/dropzone2.js +1 -1
- package/dist/file/file2.js +1 -1
- package/dist/format-datetime/format-datetime2.js +1 -1
- package/dist/format-relative-time/format-relative-time2.js +1 -1
- package/dist/forms/control/control2.js +1 -1
- package/dist/forms/control-group/control-group2.js +1 -1
- package/dist/forms/control-message/control-message2.js +1 -1
- package/dist/forms/utils/states.js.map +1 -1
- package/dist/grid/cell/cell2.js +1 -1
- package/dist/grid/column/column2.js +1 -1
- package/dist/grid/footer/footer2.js +1 -1
- package/dist/grid/grid.examples.js.map +1 -1
- package/dist/grid/grid.examples.json +2 -2
- package/dist/grid/grid2.js +1 -1
- package/dist/grid/header/header2.js +1 -1
- package/dist/grid/placeholder/placeholder2.js +1 -1
- package/dist/grid/row/row2.js +1 -1
- package/dist/icon/icon2.js +2 -2
- package/dist/icon/icons/stop.js +6 -0
- package/dist/icon/icons/stop.js.map +1 -0
- package/dist/icon/icons.d.ts +1 -0
- package/dist/icon/icons.js +1 -0
- package/dist/icon/icons.js.map +1 -1
- package/dist/icon/server.js +1 -0
- package/dist/icon/server.js.map +1 -1
- package/dist/icon-button/icon-button2.js +1 -1
- package/dist/index.js +1 -1
- package/dist/input/input-group2.js +1 -1
- package/dist/input/input2.js +1 -1
- package/dist/internal/controllers/audit.controller.js.map +1 -1
- package/dist/internal/controllers/type-native-popover.controller.js.map +1 -1
- package/dist/internal/controllers/type-ssr.controller.js.map +1 -1
- package/dist/internal/services/global.service.js +1 -1
- package/dist/internal/services/i18n.service.d.ts +1 -1
- package/dist/internal/services/i18n.service.js.map +1 -1
- package/dist/logo/logo2.js +1 -1
- package/dist/menu/menu-item2.js +1 -1
- package/dist/menu/menu2.js +1 -1
- package/dist/month/month2.js +1 -1
- package/dist/notification/notification-group2.js +1 -1
- package/dist/notification/notification2.js +1 -1
- package/dist/page/page-panel/page-panel-content2.js +1 -1
- package/dist/page/page-panel/page-panel-footer2.js +1 -1
- package/dist/page/page-panel/page-panel-header2.js +1 -1
- package/dist/page/page-panel/page-panel2.js +1 -1
- package/dist/page/page2.js +1 -1
- package/dist/page-header/page-header2.js +1 -1
- package/dist/page-loader/page-loader2.js +1 -1
- package/dist/pagination/pagination2.js +1 -1
- package/dist/panel/panel2.js +4 -4
- package/dist/password/password2.js +1 -1
- package/dist/polyfills/index.js +2 -1
- package/dist/polyfills/index.js.map +1 -1
- package/dist/preferences-input/preferences-input2.js +1 -1
- package/dist/preferences-input/preferences-input2.js.map +1 -1
- package/dist/progress-bar/progress-bar.examples.js.map +1 -1
- package/dist/progress-bar/progress-bar.examples.json +1 -1
- package/dist/progress-bar/progress-bar2.js +1 -1
- package/dist/progress-ring/progress-ring2.js +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip2.js +1 -1
- package/dist/pulse/pulse2.js +1 -1
- package/dist/radio/radio-group2.js +1 -1
- package/dist/radio/radio2.js +1 -1
- package/dist/range/range2.js +1 -1
- package/dist/resize-handle/resize-handle2.js +1 -1
- package/dist/search/search2.js +1 -1
- package/dist/select/select2.js +1 -1
- package/dist/skeleton/skeleton.d.ts +2 -2
- package/dist/skeleton/skeleton2.js +1 -1
- package/dist/skeleton/skeleton2.js.map +1 -1
- package/dist/sort-button/sort-button2.js +1 -1
- package/dist/sparkline/sparkline2.js +1 -1
- package/dist/star-rating/star-rating2.js +1 -1
- package/dist/steps/steps2.js +2 -2
- package/dist/switch/switch-group2.js +1 -1
- package/dist/switch/switch2.js +1 -1
- package/dist/tabs/tabs-group2.js +1 -1
- package/dist/tabs/tabs2.js +2 -2
- package/dist/tag/tag2.js +1 -1
- package/dist/textarea/textarea2.js +1 -1
- package/dist/time/time2.js +1 -1
- package/dist/toast/toast2.js +1 -1
- package/dist/toggletip/toggletip-footer2.js +1 -1
- package/dist/toggletip/toggletip-header2.js +1 -1
- package/dist/toggletip/toggletip2.js +1 -1
- package/dist/toolbar/toolbar.js +1 -1
- package/dist/toolbar/toolbar.js.map +1 -1
- package/dist/toolbar/toolbar2.js +1 -1
- package/dist/tooltip/tooltip2.js +1 -1
- package/dist/tree/tree-node.js +1 -1
- package/dist/tree/tree-node.js.map +1 -1
- package/dist/tree/tree-node2.js +1 -1
- package/dist/tree/tree2.js +1 -1
- package/dist/tree/utils.js.map +1 -1
- package/dist/week/week2.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { getThemeTokens as e } from "./internal/utils/dom.js";
|
|
|
2
2
|
import { I18nService as t } from "./internal/services/i18n.service.js";
|
|
3
3
|
import { statusIcons as n } from "./internal/types/index.js";
|
|
4
4
|
//#region src/index.ts
|
|
5
|
-
var r = "0.0.
|
|
5
|
+
var r = "0.0.10", i = "@nvidia-elements";
|
|
6
6
|
//#endregion
|
|
7
7
|
export { t as I18nService, i as SCOPE, r as VERSION, e as getThemeTokens, n as statusIcons };
|
|
8
8
|
|
package/dist/input/input2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.controller.js","names":["#hostAuditState","#production","#hostMetadata","#initializeAudit","#auditExcessiveInstanceLimit","#auditSlots","#auditParentElement","#cleanupExcessiveInstanceLimit","#update"],"sources":["../../../src/internal/controllers/audit.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { GlobalStateService } from '../services/global.service.js';\nimport { auditSlots, auditParentElement } from '../utils/audit.js';\n\nexport const excessiveInstanceLimit = 50;\n\nexport interface AuditOptions {\n excessiveInstanceLimit?: number;\n alternates?: { name: string; use: string }[];\n}\n\nexport interface AuditMetadata {\n parents?: string[];\n children?: string[];\n disallowedChildren?: string[];\n}\n\ninterface AuditRegistry {\n [key: string]: {\n count?: number;\n excessiveInstanceLimitAudited?: boolean;\n };\n}\n\nasync function log(message: string) {\n const { LogService } = await import('../services/log.service.js');\n LogService.warn(message);\n}\n\nexport function audit<T extends Audit>(options: AuditOptions = {}): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new AuditController(instance, options));\n}\n\nexport type Audit = ReactiveElement;\n\nexport class AuditController<T extends Audit> implements ReactiveController {\n get #hostAuditState() {\n return GlobalStateService.state.audit[this.host.localName] ?? { count: 0 };\n }\n\n get #production() {\n return GlobalStateService.state.env === 'production';\n }\n\n get #hostMetadata() {\n return (this.host.constructor as unknown as { metadata: AuditMetadata }).metadata;\n }\n\n constructor(\n private host: T,\n private options: AuditOptions\n ) {\n if (!this.#production) {\n this.host.addController(this);\n this.#initializeAudit();\n }\n }\n\n async hostConnected() {\n await this.host.updateComplete;\n if (!this.#production) {\n void this.#auditExcessiveInstanceLimit();\n void this.#auditSlots();\n void this.#auditParentElement();\n }\n }\n\n hostDisconnected() {\n this.#cleanupExcessiveInstanceLimit();\n }\n\n #initializeAudit() {\n if (!GlobalStateService.state.audit[this.host.localName]) {\n this.#update({ [this.host.localName]: { count: 0 } });\n }\n }\n\n async #auditExcessiveInstanceLimit() {\n if (this.options.excessiveInstanceLimit !== undefined) {\n if (\n this.#hostAuditState.count! > this.options.excessiveInstanceLimit &&\n !this.#hostAuditState.excessiveInstanceLimitAudited\n ) {\n const { getExcessiveInstanceLimitWarning } = await import('../utils/audit-logs.js');\n void log(getExcessiveInstanceLimitWarning(this.#hostAuditState.count!, this.host.localName));\n this.#update({\n [this.host.localName]: { count: this.#hostAuditState.count! + 1, excessiveInstanceLimitAudited: true }\n });\n } else {\n this.#update({ [this.host.localName]: { count: this.#hostAuditState.count! + 1 } });\n }\n }\n }\n\n #cleanupExcessiveInstanceLimit() {\n if (this.options.excessiveInstanceLimit) {\n this.#update({\n [this.host.localName]: { count: this.#hostAuditState.count! - 1, excessiveInstanceLimitAudited: false }\n });\n }\n }\n\n #update(
|
|
1
|
+
{"version":3,"file":"audit.controller.js","names":["#hostAuditState","#production","#hostMetadata","#initializeAudit","#auditExcessiveInstanceLimit","#auditSlots","#auditParentElement","#cleanupExcessiveInstanceLimit","#update"],"sources":["../../../src/internal/controllers/audit.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { GlobalStateService } from '../services/global.service.js';\nimport { auditSlots, auditParentElement } from '../utils/audit.js';\n\nexport const excessiveInstanceLimit = 50;\n\nexport interface AuditOptions {\n excessiveInstanceLimit?: number;\n alternates?: { name: string; use: string }[];\n}\n\nexport interface AuditMetadata {\n parents?: string[];\n children?: string[];\n disallowedChildren?: string[];\n}\n\ninterface AuditRegistry {\n [key: string]: {\n count?: number;\n excessiveInstanceLimitAudited?: boolean;\n };\n}\n\nasync function log(message: string) {\n const { LogService } = await import('../services/log.service.js');\n LogService.warn(message);\n}\n\nexport function audit<T extends Audit>(options: AuditOptions = {}): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new AuditController(instance, options));\n}\n\nexport type Audit = ReactiveElement;\n\nexport class AuditController<T extends Audit> implements ReactiveController {\n get #hostAuditState() {\n return GlobalStateService.state.audit[this.host.localName] ?? { count: 0 };\n }\n\n get #production() {\n return GlobalStateService.state.env === 'production';\n }\n\n get #hostMetadata() {\n return (this.host.constructor as unknown as { metadata: AuditMetadata }).metadata;\n }\n\n constructor(\n private host: T,\n private options: AuditOptions\n ) {\n if (!this.#production) {\n this.host.addController(this);\n this.#initializeAudit();\n }\n }\n\n async hostConnected() {\n await this.host.updateComplete;\n if (!this.#production) {\n void this.#auditExcessiveInstanceLimit();\n void this.#auditSlots();\n void this.#auditParentElement();\n }\n }\n\n hostDisconnected() {\n this.#cleanupExcessiveInstanceLimit();\n }\n\n #initializeAudit() {\n if (!GlobalStateService.state.audit[this.host.localName]) {\n this.#update({ [this.host.localName]: { count: 0 } });\n }\n }\n\n async #auditExcessiveInstanceLimit() {\n if (this.options.excessiveInstanceLimit !== undefined) {\n if (\n this.#hostAuditState.count! > this.options.excessiveInstanceLimit &&\n !this.#hostAuditState.excessiveInstanceLimitAudited\n ) {\n const { getExcessiveInstanceLimitWarning } = await import('../utils/audit-logs.js');\n void log(getExcessiveInstanceLimitWarning(this.#hostAuditState.count!, this.host.localName));\n this.#update({\n [this.host.localName]: { count: this.#hostAuditState.count! + 1, excessiveInstanceLimitAudited: true }\n });\n } else {\n this.#update({ [this.host.localName]: { count: this.#hostAuditState.count! + 1 } });\n }\n }\n }\n\n #cleanupExcessiveInstanceLimit() {\n if (this.options.excessiveInstanceLimit) {\n this.#update({\n [this.host.localName]: { count: this.#hostAuditState.count! - 1, excessiveInstanceLimitAudited: false }\n });\n }\n }\n\n #update(registry: AuditRegistry) {\n GlobalStateService.dispatch('NVE_ELEMENTS_AUDIT_UPDATE', { audit: registry } as Partial<\n typeof globalThis.NVE_ELEMENTS.state\n >);\n }\n\n async #auditSlots() {\n if (this.#hostMetadata.children || this.#hostMetadata.disallowedChildren) {\n const [invalidElements, validElements] = auditSlots(this.host);\n if (invalidElements.length) {\n const { getInvalidSlottedChildrenWarning } = await import('../utils/audit-logs.js');\n void log(getInvalidSlottedChildrenWarning(this.host.localName, validElements));\n }\n }\n }\n\n async #auditParentElement() {\n if (this.#hostMetadata.parents) {\n const [valid, validParents] = auditParentElement(this.host);\n if (!valid) {\n const { getInvalidParentWarning } = await import('../utils/audit-logs.js');\n void log(getInvalidParentWarning(this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IAAG,+BAA+B;IAAM,EACvG,CAAC;QAEF,OAAA,EAAa,GAAG,KAAK,KAAK,YAAY,EAAE,OAAO,MAAA,EAAqB,QAAS,GAAG,EAAE,CAAC;;CAKzF,KAAiC;AAC/B,EAAI,KAAK,QAAQ,0BACf,MAAA,EAAa,GACV,KAAK,KAAK,YAAY;GAAE,OAAO,MAAA,EAAqB,QAAS;GAAG,+BAA+B;GAAO,EACxG,CAAC;;CAIN,GAAQ,GAAyB;AAC/B,IAAmB,SAAS,6BAA6B,EAAE,OAAO,GAAU,CAE1E;;CAGJ,OAAA,IAAoB;AAClB,MAAI,MAAA,EAAmB,YAAY,MAAA,EAAmB,oBAAoB;GACxE,IAAM,CAAC,GAAiB,KAAiB,EAAW,KAAK,KAAK;AAC9D,OAAI,EAAgB,QAAQ;IAC1B,IAAM,EAAE,wCAAqC,MAAM,OAAO;AACrD,MAAI,EAAiC,KAAK,KAAK,WAAW,EAAc,CAAC;;;;CAKpF,OAAA,IAA4B;AAC1B,MAAI,MAAA,EAAmB,SAAS;GAC9B,IAAM,CAAC,GAAO,KAAgB,EAAmB,KAAK,KAAK;AAC3D,OAAI,CAAC,GAAO;IACV,IAAM,EAAE,+BAA4B,MAAM,OAAO;AAC5C,MAAI,EAAwB,KAAK,KAAK,WAAW,EAAa,KAAK,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-native-popover.controller.js","names":["#nativeTriggers","#updateLegacyTriggers","#setupLegacyTriggers","#setupModalLightDismiss","#toggleFocus","#parseInterestDelay","#interestTimeout","#observers","#pointerdownWithinModal","#legacyHostTrigger","#previousLegacyTrigger"],"sources":["../../../src/internal/controllers/type-native-popover.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { clickOutsideElementBounds, generateId, getAttributeListChanges } from '../utils/dom.js';\nimport { attachInternals } from '../utils/a11y.js';\nimport { focusElement } from '../utils/focus.js';\nimport { getHostAnchor, getHostTrigger, hasOpenPopover } from './type-native-popover.utils.js';\nimport type { PopoverType } from '../types/index.js';\nimport type { InterestEvent } from './type-interest.controller.js';\n\nexport interface NativePopover extends ReactiveElement {\n anchor?: HTMLElement | string;\n closeTimeout?: number;\n popoverType?: PopoverType;\n modal?: boolean;\n popoverDismissible?: boolean;\n _activeTrigger?: HTMLElement;\n _internals?: ElementInternals;\n\n /** @deprecated */\n trigger?: HTMLElement | string;\n /** @deprecated */\n openDelay?: number;\n /** @deprecated */\n behaviorTrigger?: boolean;\n}\n\n/**\n * https://open-ui.org/components/popup.research.explainer\n */\nexport class TypeNativePopoverController<T extends NativePopover> implements ReactiveController {\n get #nativeTriggers(): HTMLElement[] {\n const root = this.host.getRootNode() as HTMLElement;\n const popoverTargetTriggers = Array.from(\n root.querySelectorAll(`[popovertarget=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const commandForTriggers = Array.from(\n root.querySelectorAll(`[commandfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const interestForTriggers = Array.from(\n root.querySelectorAll(`[interestfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n return [...popoverTargetTriggers, ...commandForTriggers, ...interestForTriggers];\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n\n const showPopover = this.host.showPopover;\n this.host.showPopover = (options?: ShowPopoverOptions) => {\n if (this.host.isConnected) {\n // provide legacy fallback for source anchor or trigger if not provided, this can happen if the popover is dynamically created in the DOM without the use of the standard popover api or legacy trigger based api\n let source: HTMLElement | Element | null = options?.source ?? null;\n if (!source) {\n if (this.host.anchor) {\n source = getHostAnchor(this.host);\n } else if (this.host.trigger) {\n source = getHostTrigger(this.host, this.host.trigger);\n } else {\n source = globalThis.document.activeElement;\n }\n }\n\n showPopover.call(this.host, { source: source as HTMLElement });\n }\n };\n }\n\n async hostConnected() {\n attachInternals(this.host);\n this.host.popover = this.host.popoverType ?? null;\n await this.host.updateComplete;\n this.host.setAttribute('nve-popover', '');\n this.#updateLegacyTriggers();\n this.#setupLegacyTriggers(); // eslint-disable-line @typescript-eslint/no-floating-promises\n this.#setupModalLightDismiss();\n this.host.inert = this.host.matches(':not(:popover-open)') && !!this.#nativeTriggers.length;\n\n this.host.addEventListener('beforetoggle', e => {\n if (e.newState === 'open') {\n this.host._internals!.states.add('transition-start');\n }\n });\n\n this.host.addEventListener('toggle', (e: ToggleEvent) => {\n if (this.host.behaviorTrigger) {\n this.host.hidden = e.newState === 'closed';\n }\n\n if (e.newState === 'open' && this.host.closeTimeout) {\n setTimeout(() => this.host.hidePopover(), this.host.closeTimeout);\n }\n\n this.host.inert = this.host.matches(':not(:popover-open)');\n\n if (this.host.modal) {\n this.#toggleFocus(e.newState === 'open', e.target as HTMLElement);\n }\n\n this.host.dispatchEvent(\n new CustomEvent(e.newState === 'open' && e.oldState !== 'open' ? 'open' : 'close', {\n bubbles: true,\n composed: true,\n detail: { trigger: e.source }\n })\n );\n });\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API#creating_declarative_popovers\n this.host.addEventListener('command', ((e: CommandEvent) => {\n if (e.command === 'toggle-popover') {\n this.host.togglePopover({ source: e.source as HTMLElement });\n }\n\n if (e.command === 'hide-popover') {\n this.host.hidePopover();\n }\n\n if (e.command === 'show-popover') {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }) as EventListener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Popover_API/Using_interest_invokers\n this.host.addEventListener('interest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n const interestDelayStart = this.host.openDelay ?? this.#parseInterestDelay();\n if (interestDelayStart) {\n this.#interestTimeout = setTimeout(() => {\n if (this.host.isConnected) {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }, interestDelayStart);\n } else {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }\n }) as EventListener);\n\n this.host.addEventListener('loseinterest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n this.host.hidePopover();\n }\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }) as EventListener);\n }\n\n #interestTimeout: ReturnType<typeof setTimeout> | null = null;\n #observers: MutationObserver[] = [];\n #previousLegacyTrigger: HTMLButtonElement | null = null;\n\n async hostUpdated() {\n this.host.popover = this.host.popoverType ?? null;\n this.#updateLegacyTriggers();\n }\n\n hostDisconnected() {\n this.#observers.forEach(observer => observer.disconnect());\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }\n\n #parseInterestDelay(): number {\n const style = getComputedStyle(this.host);\n const raw = (style as unknown as { interestDelayStart: string }).interestDelayStart;\n if (!raw) {\n return 0;\n }\n const value = parseFloat(raw);\n return raw.endsWith('ms') ? value : value * 1000;\n }\n\n #pointerdownWithinModal = false;\n\n #setupModalLightDismiss() {\n this.host.addEventListener('pointerdown', e => {\n if (this.host.modal && this.host.matches(':popover-open')) {\n this.#pointerdownWithinModal = clickOutsideElementBounds(e, this.host);\n }\n });\n\n this.host.addEventListener('pointerup', e => {\n if (\n this.#pointerdownWithinModal &&\n this.host.popoverDismissible &&\n this.host.modal &&\n this.host.matches(':popover-open') &&\n !hasOpenPopover(this.host) &&\n clickOutsideElementBounds(e, this.host)\n ) {\n this.host.hidePopover();\n }\n });\n }\n\n get #legacyHostTrigger(): HTMLElement | null {\n return this.host.trigger ? (getHostTrigger(this.host, this.host.trigger) as HTMLButtonElement) : null;\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n async #setupLegacyTriggers() {\n await new Promise(r => requestAnimationFrame(r));\n\n // setup hidden updates for legacy triggers\n this.#observers.push(\n getAttributeListChanges(this.host, ['hidden'], () => {\n if (this.host.isConnected && !this.host.hidden && !this.host.matches(':popover-open')) {\n this.host.showPopover();\n }\n\n if (this.host.isConnected && this.host.hidden && this.host.matches(':popover-open')) {\n this.host.hidePopover();\n }\n })\n );\n\n // determine if popover is open by default\n if (\n this.host.isConnected &&\n !this.#nativeTriggers.length &&\n !this.host.hidden &&\n !this.host.matches(':popover-open')\n ) {\n this.host.popover = 'manual';\n this.host.showPopover();\n }\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n #updateLegacyTriggers() {\n const trigger = this.#legacyHostTrigger as HTMLButtonElement;\n\n // Clean up previous trigger if it changed\n if (this.#previousLegacyTrigger && this.#previousLegacyTrigger !== trigger) {\n this.#previousLegacyTrigger.popoverTargetElement = null;\n this.#previousLegacyTrigger.removeAttribute('popovertarget');\n }\n\n // if not a hint type setup native popovertarget\n if (trigger) {\n if (this.host.popoverType === 'hint') {\n trigger.addEventListener('mouseenter', () => this.host.showPopover({ source: trigger as HTMLElement }));\n trigger.addEventListener('mouseleave', () => this.host.hidePopover());\n trigger.addEventListener('focusout', () => this.host.hidePopover());\n } else {\n this.host.id = this.host.id ? this.host.id : generateId();\n trigger.popoverTargetElement = this.host;\n trigger.setAttribute('popovertarget', this.host.id);\n }\n this.#previousLegacyTrigger = trigger;\n }\n }\n\n #toggleFocus(open: boolean, target: HTMLElement) {\n if (open) {\n // only focus popover if not the active element and not containing the active element already\n if ((this.host.getRootNode() as Document).activeElement !== this.host && !this.host.shadowRoot!.activeElement) {\n focusElement(this.host);\n }\n } else {\n focusElement(target);\n }\n }\n}\n"],"mappings":";;;;;AA+BA,IAAa,IAAb,MAAgG;CAC9F,KAAA,IAAqC;EACnC,IAAM,IAAO,KAAK,KAAK,aAAa,EAC9B,IAAwB,MAAM,KAClC,EAAK,iBAAiB,mBAAmB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG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,aAAa;IAEzB,CACH,EAIC,KAAK,KAAK,eACV,CAAC,MAAA,EAAqB,UACtB,CAAC,KAAK,KAAK,UACX,CAAC,KAAK,KAAK,QAAQ,gBAAgB,KAEnC,KAAK,KAAK,UAAU,UACpB,KAAK,KAAK,aAAa;;CAO3B,KAAwB;EACtB,IAAM,IAAU,MAAA;AAShB,EANI,MAAA,KAA+B,MAAA,MAAgC,MACjE,MAAA,EAA4B,uBAAuB,MACnD,MAAA,EAA4B,gBAAgB,gBAAgB,GAI1D,MACE,KAAK,KAAK,gBAAgB,UAC5B,EAAQ,iBAAiB,oBAAoB,KAAK,KAAK,YAAY,EAAE,QAAQ,GAAwB,CAAC,CAAC,EACvG,EAAQ,iBAAiB,oBAAoB,KAAK,KAAK,aAAa,CAAC,EACrE,EAAQ,iBAAiB,kBAAkB,KAAK,KAAK,aAAa,CAAC,KAEnE,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAY,EACzD,EAAQ,uBAAuB,KAAK,MACpC,EAAQ,aAAa,iBAAiB,KAAK,KAAK,GAAG,GAErD,MAAA,IAA8B;;CAIlC,GAAa,GAAe,GAAqB;AAC/C,EAAI,IAEG,KAAK,KAAK,aAAa,CAAc,kBAAkB,KAAK,QAAQ,CAAC,KAAK,KAAK,WAAY,iBAC9F,EAAa,KAAK,KAAK,GAGzB,EAAa,EAAO"}
|
|
1
|
+
{"version":3,"file":"type-native-popover.controller.js","names":["#nativeTriggers","#updateLegacyTriggers","#setupLegacyTriggers","#setupModalLightDismiss","#toggleFocus","#parseInterestDelay","#interestTimeout","#observers","#pointerdownWithinModal","#legacyHostTrigger","#previousLegacyTrigger"],"sources":["../../../src/internal/controllers/type-native-popover.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { clickOutsideElementBounds, generateId, getAttributeListChanges } from '../utils/dom.js';\nimport { attachInternals } from '../utils/a11y.js';\nimport { focusElement } from '../utils/focus.js';\nimport { getHostAnchor, getHostTrigger, hasOpenPopover } from './type-native-popover.utils.js';\nimport type { PopoverType } from '../types/index.js';\nimport type { InterestEvent } from './type-interest.controller.js';\n\nexport interface NativePopover extends ReactiveElement {\n anchor?: HTMLElement | string;\n closeTimeout?: number;\n popoverType?: PopoverType;\n modal?: boolean;\n popoverDismissible?: boolean;\n _activeTrigger?: HTMLElement;\n _internals?: ElementInternals;\n\n /** @deprecated */\n trigger?: HTMLElement | string;\n /** @deprecated */\n openDelay?: number;\n /** @deprecated */\n behaviorTrigger?: boolean;\n}\n\n/**\n * https://open-ui.org/components/popup.research.explainer\n */\nexport class TypeNativePopoverController<T extends NativePopover> implements ReactiveController {\n get #nativeTriggers(): HTMLElement[] {\n const root = this.host.getRootNode() as HTMLElement;\n const popoverTargetTriggers = Array.from(\n root.querySelectorAll(`[popovertarget=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const commandForTriggers = Array.from(\n root.querySelectorAll(`[commandfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const interestForTriggers = Array.from(\n root.querySelectorAll(`[interestfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n return [...popoverTargetTriggers, ...commandForTriggers, ...interestForTriggers];\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n\n const showPopover = this.host.showPopover;\n this.host.showPopover = (options?: ShowPopoverOptions) => {\n if (this.host.isConnected) {\n // provide legacy fallback for source anchor or trigger if not provided, this can happen if the popover is dynamically created in the DOM without the use of the standard popover api or legacy trigger based api\n let source: HTMLElement | Element | null = options?.source ?? null;\n if (!source) {\n if (this.host.anchor) {\n source = getHostAnchor(this.host);\n } else if (this.host.trigger) {\n source = getHostTrigger(this.host, this.host.trigger);\n } else {\n source = globalThis.document.activeElement;\n }\n }\n\n showPopover.call(this.host, { source: source as HTMLElement });\n }\n };\n }\n\n // eslint-disable-next-line max-lines-per-function\n async hostConnected() {\n attachInternals(this.host);\n this.host.popover = this.host.popoverType ?? null;\n await this.host.updateComplete;\n this.host.setAttribute('nve-popover', '');\n this.#updateLegacyTriggers();\n this.#setupLegacyTriggers(); // eslint-disable-line @typescript-eslint/no-floating-promises\n this.#setupModalLightDismiss();\n this.host.inert = this.host.matches(':not(:popover-open)') && !!this.#nativeTriggers.length;\n\n this.host.addEventListener('beforetoggle', e => {\n if (e.newState === 'open') {\n this.host._internals!.states.add('transition-start');\n }\n });\n\n this.host.addEventListener('toggle', (e: ToggleEvent) => {\n if (this.host.behaviorTrigger) {\n this.host.hidden = e.newState === 'closed';\n }\n\n if (e.newState === 'open' && this.host.closeTimeout) {\n setTimeout(() => this.host.hidePopover(), this.host.closeTimeout);\n }\n\n this.host.inert = this.host.matches(':not(:popover-open)');\n\n if (this.host.modal) {\n this.#toggleFocus(e.newState === 'open', e.target as HTMLElement);\n }\n\n this.host.dispatchEvent(\n new CustomEvent(e.newState === 'open' && e.oldState !== 'open' ? 'open' : 'close', {\n bubbles: true,\n composed: true,\n detail: { trigger: e.source }\n })\n );\n });\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API#creating_declarative_popovers\n this.host.addEventListener('command', ((e: CommandEvent) => {\n if (e.command === 'toggle-popover') {\n this.host.togglePopover({ source: e.source as HTMLElement });\n }\n\n if (e.command === 'hide-popover') {\n this.host.hidePopover();\n }\n\n if (e.command === 'show-popover') {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }) as EventListener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Popover_API/Using_interest_invokers\n this.host.addEventListener('interest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n const interestDelayStart = this.host.openDelay ?? this.#parseInterestDelay();\n if (interestDelayStart) {\n this.#interestTimeout = setTimeout(() => {\n if (this.host.isConnected) {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }, interestDelayStart);\n } else {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }\n }) as EventListener);\n\n this.host.addEventListener('loseinterest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n this.host.hidePopover();\n }\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }) as EventListener);\n }\n\n #interestTimeout: ReturnType<typeof setTimeout> | null = null;\n #observers: MutationObserver[] = [];\n #previousLegacyTrigger: HTMLButtonElement | null = null;\n\n async hostUpdated() {\n this.host.popover = this.host.popoverType ?? null;\n this.#updateLegacyTriggers();\n }\n\n hostDisconnected() {\n this.#observers.forEach(observer => observer.disconnect());\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }\n\n #parseInterestDelay(): number {\n const style = getComputedStyle(this.host);\n const raw = (style as unknown as { interestDelayStart: string }).interestDelayStart;\n if (!raw) {\n return 0;\n }\n const value = parseFloat(raw);\n return raw.endsWith('ms') ? value : value * 1000;\n }\n\n #pointerdownWithinModal = false;\n\n #setupModalLightDismiss() {\n this.host.addEventListener('pointerdown', e => {\n if (this.host.modal && this.host.matches(':popover-open')) {\n this.#pointerdownWithinModal = clickOutsideElementBounds(e, this.host);\n }\n });\n\n this.host.addEventListener('pointerup', e => {\n if (\n this.#pointerdownWithinModal &&\n this.host.popoverDismissible &&\n this.host.modal &&\n this.host.matches(':popover-open') &&\n !hasOpenPopover(this.host) &&\n clickOutsideElementBounds(e, this.host)\n ) {\n this.host.hidePopover();\n }\n });\n }\n\n get #legacyHostTrigger(): HTMLElement | null {\n return this.host.trigger ? (getHostTrigger(this.host, this.host.trigger) as HTMLButtonElement) : null;\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n async #setupLegacyTriggers() {\n await new Promise(r => requestAnimationFrame(r));\n\n // setup hidden updates for legacy triggers\n this.#observers.push(\n getAttributeListChanges(this.host, ['hidden'], () => {\n if (this.host.isConnected && !this.host.hidden && !this.host.matches(':popover-open')) {\n this.host.showPopover();\n }\n\n if (this.host.isConnected && this.host.hidden && this.host.matches(':popover-open')) {\n this.host.hidePopover();\n }\n })\n );\n\n // determine if popover is open by default\n if (\n this.host.isConnected &&\n !this.#nativeTriggers.length &&\n !this.host.hidden &&\n !this.host.matches(':popover-open')\n ) {\n this.host.popover = 'manual';\n this.host.showPopover();\n }\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n #updateLegacyTriggers() {\n const trigger = this.#legacyHostTrigger as HTMLButtonElement;\n\n // Clean up previous trigger if it changed\n if (this.#previousLegacyTrigger && this.#previousLegacyTrigger !== trigger) {\n this.#previousLegacyTrigger.popoverTargetElement = null;\n this.#previousLegacyTrigger.removeAttribute('popovertarget');\n }\n\n // if not a hint type setup native popovertarget\n if (trigger) {\n if (this.host.popoverType === 'hint') {\n trigger.addEventListener('mouseenter', () => this.host.showPopover({ source: trigger as HTMLElement }));\n trigger.addEventListener('mouseleave', () => this.host.hidePopover());\n trigger.addEventListener('focusout', () => this.host.hidePopover());\n } else {\n this.host.id = this.host.id ? this.host.id : generateId();\n trigger.popoverTargetElement = this.host;\n trigger.setAttribute('popovertarget', this.host.id);\n }\n this.#previousLegacyTrigger = trigger;\n }\n }\n\n #toggleFocus(open: boolean, target: HTMLElement) {\n if (open) {\n // only focus popover if not the active element and not containing the active element already\n if ((this.host.getRootNode() as Document).activeElement !== this.host && !this.host.shadowRoot!.activeElement) {\n focusElement(this.host);\n }\n } else {\n focusElement(target);\n }\n }\n}\n"],"mappings":";;;;;AA+BA,IAAa,IAAb,MAAgG;CAC9F,KAAA,IAAqC;EACnC,IAAM,IAAO,KAAK,KAAK,aAAa,EAC9B,IAAwB,MAAM,KAClC,EAAK,iBAAiB,mBAAmB,IAAI,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K,QAAQ,gBAAgB,IACjF,KAAK,KAAK,aAAa;IAEzB,CACH,EAIC,KAAK,KAAK,eACV,CAAC,MAAA,EAAqB,UACtB,CAAC,KAAK,KAAK,UACX,CAAC,KAAK,KAAK,QAAQ,gBAAgB,KAEnC,KAAK,KAAK,UAAU,UACpB,KAAK,KAAK,aAAa;;CAO3B,KAAwB;EACtB,IAAM,IAAU,MAAA;AAShB,EANI,MAAA,KAA+B,MAAA,MAAgC,MACjE,MAAA,EAA4B,uBAAuB,MACnD,MAAA,EAA4B,gBAAgB,gBAAgB,GAI1D,MACE,KAAK,KAAK,gBAAgB,UAC5B,EAAQ,iBAAiB,oBAAoB,KAAK,KAAK,YAAY,EAAE,QAAQ,GAAwB,CAAC,CAAC,EACvG,EAAQ,iBAAiB,oBAAoB,KAAK,KAAK,aAAa,CAAC,EACrE,EAAQ,iBAAiB,kBAAkB,KAAK,KAAK,aAAa,CAAC,KAEnE,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAY,EACzD,EAAQ,uBAAuB,KAAK,MACpC,EAAQ,aAAa,iBAAiB,KAAK,KAAK,GAAG,GAErD,MAAA,IAA8B;;CAIlC,GAAa,GAAe,GAAqB;AAC/C,EAAI,IAEG,KAAK,KAAK,aAAa,CAAc,kBAAkB,KAAK,QAAQ,CAAC,KAAK,KAAK,WAAY,iBAC9F,EAAa,KAAK,KAAK,GAGzB,EAAa,EAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-ssr.controller.js","names":["#firstUpdate"],"sources":["../../../src/internal/controllers/type-ssr.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement, RenderOptions, TemplateResult } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { render } from 'lit';\nimport { LogService } from '../services/log.service.js';\nimport { getSSRMismatchWarning } from '../utils/audit-logs.js';\nimport { getEnv } from '../services/global.utils.js';\n\ntype UnprotectedLitElement = ReactiveElement & {\n update: () => void;\n render: () => TemplateResult;\n renderOptions: RenderOptions;\n _internals?: ElementInternals;\n};\n\n/**\n * Catch and manage hydration related fallbacks for SSR\n */\nexport function typeSSR<T extends UnprotectedLitElement>(options: { log?: boolean } = { log: true }): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!(\n (instance: T & { _internals: ElementInternals }) => new TypeSSRController(instance, options)\n );\n}\n\nexport class TypeSSRController<T extends ReactiveElement> implements ReactiveController {\n // https://www.konnorrogers.com/posts/2024/running-lit-ssr-in-web-awesome#hydration-errors\n didSSR = Boolean(this.host.shadowRoot);\n\n constructor(\n private host: T & UnprotectedLitElement,\n private options: { log?: boolean }\n ) {\n this.host.addController(this);\n\n // https://github.com/lit/lit/issues/1434#issuecomment-1598332000\n if (this.didSSR) {\n const
|
|
1
|
+
{"version":3,"file":"type-ssr.controller.js","names":["#firstUpdate"],"sources":["../../../src/internal/controllers/type-ssr.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement, RenderOptions, TemplateResult } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { render } from 'lit';\nimport { LogService } from '../services/log.service.js';\nimport { getSSRMismatchWarning } from '../utils/audit-logs.js';\nimport { getEnv } from '../services/global.utils.js';\n\ntype UnprotectedLitElement = ReactiveElement & {\n update: () => void;\n render: () => TemplateResult;\n renderOptions: RenderOptions;\n _internals?: ElementInternals;\n};\n\n/**\n * Catch and manage hydration related fallbacks for SSR\n */\nexport function typeSSR<T extends UnprotectedLitElement>(options: { log?: boolean } = { log: true }): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!(\n (instance: T & { _internals: ElementInternals }) => new TypeSSRController(instance, options)\n );\n}\n\nexport class TypeSSRController<T extends ReactiveElement> implements ReactiveController {\n // https://www.konnorrogers.com/posts/2024/running-lit-ssr-in-web-awesome#hydration-errors\n didSSR = Boolean(this.host.shadowRoot);\n\n constructor(\n private host: T & UnprotectedLitElement,\n private options: { log?: boolean }\n ) {\n this.host.addController(this);\n\n // https://github.com/lit/lit/issues/1434#issuecomment-1598332000\n if (this.didSSR) {\n const controllerOptions = this.options;\n const updateOriginal = host.update;\n Object.defineProperty(host, 'update', {\n value: function () {\n try {\n updateOriginal.call(host);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (_) {\n const renderRoot = host.renderRoot as HTMLElement;\n renderRoot.innerHTML = renderRoot.innerHTML.split('<!--lit-part ')[0]!;\n render(host.render(), renderRoot, host.renderOptions);\n\n if (getEnv() !== 'production' && controllerOptions.log) {\n LogService.warn(getSSRMismatchWarning(host.localName));\n }\n }\n return updateOriginal;\n }\n });\n }\n }\n\n #firstUpdate = true;\n hostUpdated() {\n // https://github.com/lit/lit/discussions/4697\n // https://github.com/w3c/csswg-drafts/issues/6867#issuecomment-1599444407\n if (this.didSSR && this.#firstUpdate) {\n this.#firstUpdate = false;\n this.host.shadowRoot?.querySelectorAll('slot').forEach(slotElement => {\n slotElement.dispatchEvent(new Event('slotchange', { bubbles: true, composed: false, cancelable: false }));\n });\n\n // if SSR reflect role attribute to host\n if (this.host._internals?.role) {\n this.host.setAttribute('role', this.host._internals.role);\n }\n }\n }\n}\n"],"mappings":";;;;;AAoBA,SAAgB,EAAyC,IAA6B,EAAE,KAAK,IAAM,EAAkB;AACnH,SAAQ,MACN,EAAO,gBACJ,MAAmD,IAAI,EAAkB,GAAU,EAAQ,CAC7F;;AAGL,IAAa,IAAb,MAAwF;CAItF,YACE,GACA,GACA;AAIA,MANQ,KAAA,OAAA,GACA,KAAA,UAAA,iBAJD,EAAQ,KAAK,KAAK,YAMzB,KAAK,KAAK,cAAc,KAAK,EAGzB,KAAK,QAAQ;GACf,IAAM,IAAoB,KAAK,SACzB,IAAiB,EAAK;AAC5B,UAAO,eAAe,GAAM,UAAU,EACpC,OAAO,WAAY;AACjB,QAAI;AACF,OAAe,KAAK,EAAK;YAEf;KACV,IAAM,IAAa,EAAK;AAIxB,KAHA,EAAW,YAAY,EAAW,UAAU,MAAM,gBAAgB,CAAC,IACnE,EAAO,EAAK,QAAQ,EAAE,GAAY,EAAK,cAAc,EAEjD,GAAQ,KAAK,gBAAgB,EAAkB,OACjD,EAAW,KAAK,EAAsB,EAAK,UAAU,CAAC;;AAG1D,WAAO;MAEV,CAAC;;;CAIN,KAAe;CACf,cAAc;AAGZ,EAAI,KAAK,UAAU,MAAA,MACjB,MAAA,IAAoB,IACpB,KAAK,KAAK,YAAY,iBAAiB,OAAO,CAAC,SAAQ,MAAe;AACpE,KAAY,cAAc,IAAI,MAAM,cAAc;IAAE,SAAS;IAAM,UAAU;IAAO,YAAY;IAAO,CAAC,CAAC;IACzG,EAGE,KAAK,KAAK,YAAY,QACxB,KAAK,KAAK,aAAa,QAAQ,KAAK,KAAK,WAAW,KAAK"}
|
|
@@ -19,7 +19,7 @@ var a = class {
|
|
|
19
19
|
i18nRegistry: {},
|
|
20
20
|
audit: {}
|
|
21
21
|
}
|
|
22
|
-
}, globalThis.NVE_ELEMENTS.state.versions = Array.from(new Set([...globalThis.NVE_ELEMENTS.state.versions, "0.0.
|
|
22
|
+
}, globalThis.NVE_ELEMENTS.state.versions = Array.from(new Set([...globalThis.NVE_ELEMENTS.state.versions, "0.0.10"])), globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}, globalThis.NVE_ELEMENTS.state.scopedRegistry["0.0.10"] = i(), globalThis.NVE_ELEMENTS.state.versions.length > 1 && globalThis.NVE_ELEMENTS.state.env !== "production" && console.warn(e(), `\n\n${JSON.stringify(globalThis.NVE_ELEMENTS.state.versions, null, 2)}`);
|
|
23
23
|
}
|
|
24
24
|
get state() {
|
|
25
25
|
return globalThis.NVE_ELEMENTS.state;
|
|
@@ -40,6 +40,6 @@ export interface I18nStrings {
|
|
|
40
40
|
export declare class I18nService_ {
|
|
41
41
|
get i18n(): Partial<I18nStrings>;
|
|
42
42
|
constructor();
|
|
43
|
-
update(
|
|
43
|
+
update(registry: Partial<typeof globalThis.NVE_ELEMENTS.state.i18nRegistry>): void;
|
|
44
44
|
}
|
|
45
45
|
export declare const I18nService: I18nService_;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.service.js","names":[],"sources":["../../../src/internal/services/i18n.service.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { GlobalStateService } from './global.service.js';\n\nexport interface I18nStrings {\n close: string;\n copy: string;\n copied: string;\n expand: string;\n select: string;\n selected: string;\n sort: string;\n show: string;\n hide: string;\n loading: string;\n previous: string;\n next: string;\n start: string;\n end: string;\n currentPage: string;\n noResults: string;\n status: string;\n information: string;\n warning: string;\n success: string;\n danger: string;\n trend: string;\n down: string;\n up: string;\n neutral: string;\n of: string;\n theme: string;\n scale: string;\n reducedMotion: string;\n colorScheme: string;\n resize: string;\n or: string;\n files: string;\n dragAndDrop: string;\n browseFiles: string;\n maxFileSize: string;\n create: string;\n}\n\nconst i18nRegistry = {\n close: 'close',\n copy: 'copy',\n copied: 'copied',\n expand: 'expand',\n select: 'select',\n selected: 'selected',\n sort: 'sort',\n show: 'show',\n hide: 'hide',\n loading: 'loading',\n previous: 'previous',\n next: 'next',\n start: 'start',\n end: 'end',\n currentPage: 'current page',\n noResults: 'no results',\n status: 'status',\n information: 'information',\n warning: 'warning',\n success: 'success',\n danger: 'danger',\n trend: 'trend',\n down: 'down',\n up: 'up',\n neutral: 'neutral',\n of: 'of',\n theme: 'theme',\n scale: 'scale',\n reducedMotion: 'reduced motion',\n colorScheme: 'color scheme',\n resize: 'resize',\n or: 'or',\n files: 'files',\n dragAndDrop: 'drag & drop',\n browseFiles: 'browse files',\n maxFileSize: 'max file size',\n create: 'create'\n};\n\nexport class I18nService_ {\n get i18n(): Partial<I18nStrings> {\n return { ...GlobalStateService.state.i18nRegistry };\n }\n\n constructor() {\n if (Object.keys(GlobalStateService.state.i18nRegistry).length === 0) {\n GlobalStateService.dispatch('NVE_ELEMENTS_I18N_UPDATE', { i18nRegistry });\n }\n }\n\n update(
|
|
1
|
+
{"version":3,"file":"i18n.service.js","names":[],"sources":["../../../src/internal/services/i18n.service.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { GlobalStateService } from './global.service.js';\n\nexport interface I18nStrings {\n close: string;\n copy: string;\n copied: string;\n expand: string;\n select: string;\n selected: string;\n sort: string;\n show: string;\n hide: string;\n loading: string;\n previous: string;\n next: string;\n start: string;\n end: string;\n currentPage: string;\n noResults: string;\n status: string;\n information: string;\n warning: string;\n success: string;\n danger: string;\n trend: string;\n down: string;\n up: string;\n neutral: string;\n of: string;\n theme: string;\n scale: string;\n reducedMotion: string;\n colorScheme: string;\n resize: string;\n or: string;\n files: string;\n dragAndDrop: string;\n browseFiles: string;\n maxFileSize: string;\n create: string;\n}\n\nconst i18nRegistry = {\n close: 'close',\n copy: 'copy',\n copied: 'copied',\n expand: 'expand',\n select: 'select',\n selected: 'selected',\n sort: 'sort',\n show: 'show',\n hide: 'hide',\n loading: 'loading',\n previous: 'previous',\n next: 'next',\n start: 'start',\n end: 'end',\n currentPage: 'current page',\n noResults: 'no results',\n status: 'status',\n information: 'information',\n warning: 'warning',\n success: 'success',\n danger: 'danger',\n trend: 'trend',\n down: 'down',\n up: 'up',\n neutral: 'neutral',\n of: 'of',\n theme: 'theme',\n scale: 'scale',\n reducedMotion: 'reduced motion',\n colorScheme: 'color scheme',\n resize: 'resize',\n or: 'or',\n files: 'files',\n dragAndDrop: 'drag & drop',\n browseFiles: 'browse files',\n maxFileSize: 'max file size',\n create: 'create'\n};\n\nexport class I18nService_ {\n get i18n(): Partial<I18nStrings> {\n return { ...GlobalStateService.state.i18nRegistry };\n }\n\n constructor() {\n if (Object.keys(GlobalStateService.state.i18nRegistry).length === 0) {\n GlobalStateService.dispatch('NVE_ELEMENTS_I18N_UPDATE', { i18nRegistry });\n }\n }\n\n update(registry: Partial<typeof globalThis.NVE_ELEMENTS.state.i18nRegistry>) {\n GlobalStateService.dispatch('NVE_ELEMENTS_I18N_UPDATE', { i18nRegistry: registry } as Partial<\n typeof globalThis.NVE_ELEMENTS.state\n >);\n }\n}\n\nexport const I18nService = new I18nService_();\n"],"mappings":";;AA6CA,IAAM,IAAe;CACnB,OAAO;CACP,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,MAAM;CACN,MAAM;CACN,MAAM;CACN,SAAS;CACT,UAAU;CACV,MAAM;CACN,OAAO;CACP,KAAK;CACL,aAAa;CACb,WAAW;CACX,QAAQ;CACR,aAAa;CACb,SAAS;CACT,SAAS;CACT,QAAQ;CACR,OAAO;CACP,MAAM;CACN,IAAI;CACJ,SAAS;CACT,IAAI;CACJ,OAAO;CACP,OAAO;CACP,eAAe;CACf,aAAa;CACb,QAAQ;CACR,IAAI;CACJ,OAAO;CACP,aAAa;CACb,aAAa;CACb,aAAa;CACb,QAAQ;CACT,EAEY,IAAb,MAA0B;CACxB,IAAI,OAA6B;AAC/B,SAAO,EAAE,GAAG,EAAmB,MAAM,cAAc;;CAGrD,cAAc;AACZ,EAAI,OAAO,KAAK,EAAmB,MAAM,aAAa,CAAC,WAAW,KAChE,EAAmB,SAAS,4BAA4B,EAAE,iBAAc,CAAC;;CAI7E,OAAO,GAAsE;AAC3E,IAAmB,SAAS,4BAA4B,EAAE,cAAc,GAAU,CAEhF;;GAIO,IAAc,IAAI,GAAc"}
|
package/dist/logo/logo2.js
CHANGED
package/dist/menu/menu-item2.js
CHANGED
package/dist/menu/menu2.js
CHANGED
package/dist/month/month2.js
CHANGED
package/dist/page/page2.js
CHANGED
package/dist/panel/panel2.js
CHANGED
|
@@ -21,7 +21,7 @@ var g = class extends f {
|
|
|
21
21
|
static {
|
|
22
22
|
this.metadata = {
|
|
23
23
|
tag: "nve-panel-header",
|
|
24
|
-
version: "0.0.
|
|
24
|
+
version: "0.0.10"
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
@@ -37,7 +37,7 @@ var g = class extends f {
|
|
|
37
37
|
static {
|
|
38
38
|
this.metadata = {
|
|
39
39
|
tag: "nve-panel-content",
|
|
40
|
-
version: "0.0.
|
|
40
|
+
version: "0.0.10"
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
@@ -50,7 +50,7 @@ var g = class extends f {
|
|
|
50
50
|
static {
|
|
51
51
|
this.metadata = {
|
|
52
52
|
tag: "nve-panel-footer",
|
|
53
|
-
version: "0.0.
|
|
53
|
+
version: "0.0.10"
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
render() {
|
|
@@ -69,7 +69,7 @@ var g = class extends f {
|
|
|
69
69
|
static {
|
|
70
70
|
this.metadata = {
|
|
71
71
|
tag: "nve-panel",
|
|
72
|
-
version: "0.0.
|
|
72
|
+
version: "0.0.10"
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
static {
|
package/dist/polyfills/index.js
CHANGED
|
@@ -3,7 +3,8 @@ import "element-internals-polyfill";
|
|
|
3
3
|
import "formdata-polyfill";
|
|
4
4
|
//#region src/polyfills/index.ts
|
|
5
5
|
Element.prototype.toggleAttribute || (Element.prototype.toggleAttribute = function(e, t) {
|
|
6
|
-
|
|
6
|
+
let n = t === void 0 ? void 0 : !!t;
|
|
7
|
+
return this.hasAttribute(e) ? n ? !0 : (this.removeAttribute(e), !1) : n === !1 ? !1 : (this.setAttribute(e, ""), !0);
|
|
7
8
|
});
|
|
8
9
|
//#endregion
|
|
9
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/polyfills/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * - Vitest (happy-dom/js-dom)\n * - Safari\n *\n * Used for Custom Elements Form/A11y APIs\n * https://github.com/whatwg/html/pull/8467\n * https://bugs.webkit.org/show_bug.cgi?id=215911\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1588763\n */\nimport 'construct-style-sheets-polyfill';\nimport 'element-internals-polyfill';\nimport 'formdata-polyfill';\nimport './custom-state-set.js';\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute\n * - Vitest (happy-dom/js-dom)\n * - Safari\n *\n * Used in element-internals-polyfill\n */\nif (!Element.prototype.toggleAttribute) {\n Element.prototype.toggleAttribute = function (name, force) {\n
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/polyfills/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * - Vitest (happy-dom/js-dom)\n * - Safari\n *\n * Used for Custom Elements Form/A11y APIs\n * https://github.com/whatwg/html/pull/8467\n * https://bugs.webkit.org/show_bug.cgi?id=215911\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1588763\n */\nimport 'construct-style-sheets-polyfill';\nimport 'element-internals-polyfill';\nimport 'formdata-polyfill';\nimport './custom-state-set.js';\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute\n * - Vitest (happy-dom/js-dom)\n * - Safari\n *\n * Used in element-internals-polyfill\n */\nif (!Element.prototype.toggleAttribute) {\n Element.prototype.toggleAttribute = function (name, force) {\n const forceBool = force !== void 0 ? !!force : undefined;\n\n if (this.hasAttribute(name)) {\n if (forceBool) {\n return true;\n }\n\n this.removeAttribute(name);\n return false;\n }\n if (forceBool === false) {\n return false;\n }\n\n this.setAttribute(name, '');\n return true;\n };\n}\n"],"mappings":";;;;AAwBK,QAAQ,UAAU,oBACrB,QAAQ,UAAU,kBAAkB,SAAU,GAAM,GAAO;CACzD,IAAM,IAAY,MAAU,KAAK,IAAc,KAAA,IAAV,CAAC,CAAC;AAevC,QAbI,KAAK,aAAa,EAAK,GACrB,IACK,MAGT,KAAK,gBAAgB,EAAK,EACnB,MAEL,MAAc,KACT,MAGT,KAAK,aAAa,GAAM,GAAG,EACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences-input2.js","names":["#setColorScheme","#setScale","#setReducedMotion","#i18nController","#updatePreferences","#update"],"sources":["../../src/preferences-input/preferences-input.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, isServer, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { I18nController, scopedRegistry, useStyles } from '@nvidia-elements/core/internal';\nimport { state } from 'lit/decorators/state.js';\nimport { FormControlMixin } from '@nvidia-elements/forms/mixin';\nimport { type IconName, Icon } from '@nvidia-elements/core/icon';\nimport { Control } from '@nvidia-elements/core/forms';\nimport { Divider } from '@nvidia-elements/core/divider';\nimport { Menu, MenuItem } from '@nvidia-elements/core/menu';\nimport { Switch } from '@nvidia-elements/core/switch';\nimport styles from './preferences-input.css?inline';\n\nexport type ColorScheme = 'auto' | 'light' | 'dark' | 'high-contrast';\nexport type Scale = 'default' | 'compact' | 'relaxed';\nexport type Variant = 'reduced-motion';\n\nconst colorSchemes: ColorScheme[] = ['auto', 'light', 'dark', 'high-contrast'];\nconst scales: Scale[] = ['default', 'compact'];\nconst colorSchemesIcons = {\n auto: 'computer',\n light: 'sun',\n dark: 'moon',\n 'high-contrast': 'circle-half'\n} satisfies Record<ColorScheme, IconName>;\n\nfunction getActivePreferences(element = globalThis.document.documentElement) {\n const computedStyle = getComputedStyle(element);\n\n return {\n light: computedStyle.getPropertyValue('--nve-config-color-scheme-light') === 'true',\n dark: computedStyle.getPropertyValue('--nve-config-color-scheme-dark') === 'true',\n 'high-contrast': computedStyle.getPropertyValue('--nve-config-color-scheme-high-contrast') === 'true',\n compact: computedStyle.getPropertyValue('--nve-config-scale-compact') === 'true',\n 'reduced-motion': computedStyle.getPropertyValue('--nve-config-reduced-motion') === 'true'\n } satisfies Partial<Record<ColorScheme | Scale | Variant, boolean>>;\n}\n\nexport interface PreferencesInputValue {\n 'color-scheme'?: ColorScheme | string;\n scale?: Scale | string;\n 'reduced-motion'?: boolean;\n}\n\n/**\n * @element nve-preferences-input\n * @description A preferences input is a widget for controlling apperance. Stylesheets register to the preferences input by including a css-property, see Standard for an example.\n * @since 1.23.7\n * @entrypoint \\@nvidia-elements/core/preferences-input\n * @event input - Dispatched when the value has changed\n * @event change - Dispatched when the value has changed\n * @cssprop --color\n * @cssprop --width\n * @csspart control - The control wrapper elements that contain the labels and menus\n * @csspart menu - The menu elements that display color scheme and scale options\n * @csspart menu-item - The individual menu item elements for each selectable option\n * @csspart icon - The icon element displayed next to color scheme options\n * @csspart divider - The divider elements that separate preference sections\n * @csspart switch - The switch element for the reduced motion toggle\n *\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/listbox/\n *\n */\n@scopedRegistry()\nexport class PreferencesInput extends FormControlMixin<typeof LitElement, PreferencesInputValue>(LitElement) {\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n /**\n * Enables updating internal string values for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-preferences-input',\n version: '0.0.0',\n valueSchema: {\n type: 'object' as const,\n properties: {\n 'color-scheme': { type: 'string' as const },\n scale: { type: 'string' as const },\n 'reduced-motion': { type: 'boolean' as const }\n }\n }\n };\n\n static elementDefinitions = {\n [Control.metadata.tag]: Control,\n [Divider.metadata.tag]: Divider,\n [Icon.metadata.tag]: Icon,\n [Menu.metadata.tag]: Menu,\n [MenuItem.metadata.tag]: MenuItem,\n [Switch.metadata.tag]: Switch\n };\n\n @state() private activePreferences: ReturnType<typeof getActivePreferences> = {\n light: false,\n dark: false,\n 'high-contrast': false,\n compact: false,\n 'reduced-motion': false\n };\n\n render() {\n return html`\n <div internal-host>\n <nve-control part=\"control\">\n <label>${this.i18n.colorScheme}</label>\n <nve-menu part=\"menu\" nve-control>\n ${colorSchemes.map(\n value => html`\n <nve-menu-item part=\"menu-item\"\n .selected=${this.value?.['color-scheme'] === value}\n .value=${value}\n @click=${() => this.#setColorScheme(value)}\n >\n <nve-icon part=\"icon\" name=${colorSchemesIcons[value]}></nve-icon> ${value}\n </nve-menu-item>\n `\n )}\n </nve-menu>\n </nve-control>\n ${\n this.activePreferences['compact']\n ? html`\n <nve-divider part=\"divider\"></nve-divider>\n <nve-control part=\"control\">\n <label>${this.i18n.scale}</label>\n <nve-menu part=\"menu\" nve-control>\n ${scales.map(\n value => html`\n <nve-menu-item part=\"menu-item\"\n .selected=${this.value?.['scale'] === value}\n .value=${value}\n @click=${() => this.#setScale(value)}\n >\n ${value}\n </nve-menu-item>\n `\n )}\n </nve-menu>\n </nve-control>\n `\n : ''\n }\n ${\n this.activePreferences['reduced-motion']\n ? html`\n <nve-divider part=\"divider\"></nve-divider>\n <nve-switch part=\"switch\">\n <label>${this.i18n.reducedMotion}</label>\n <input\n type=\"checkbox\"\n value=\"reduced-motion\"\n .checked=${this.value?.['reduced-motion']}\n @change=${(e: { target: HTMLInputElement }) => this.#setReducedMotion(e.target.checked)}\n />\n </nve-switch>`\n : ''\n }\n </div>\n `;\n }\n\n constructor() {\n super();\n this.value = {\n 'color-scheme': 'auto',\n 'reduced-motion': false,\n scale: 'default'\n };\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('nve-control', '');\n this.#updatePreferences();\n }\n\n /** @private */\n updateValue(value: PreferencesInputValue) {\n super.updateValue({ ...this.value, ...value });\n this.#updatePreferences();\n }\n\n #updatePreferences() {\n if (!isServer) {\n const preferences = getActivePreferences();\n if (JSON.stringify(this.activePreferences) !== JSON.stringify(preferences)) {\n this.activePreferences = preferences;\n }\n }\n }\n\n #setColorScheme(value: ColorScheme) {\n this.value = { ...this.value, 'color-scheme': value };\n this.#update();\n }\n\n #setScale(value: Scale) {\n this.value = { ...this.value, scale: value };\n this.#update();\n }\n\n #setReducedMotion(value: boolean) {\n this.value = { ...this.value, 'reduced-motion': value };\n this.#update();\n }\n\n #update() {\n this.dispatchInputEvent();\n this.dispatchChangeEvent();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAM,IAA8B;CAAC;CAAQ;CAAS;CAAQ;CAAgB,EACxE,IAAkB,CAAC,WAAW,UAAU,EACxC,IAAoB;CACxB,MAAM;CACN,OAAO;CACP,MAAM;CACN,iBAAiB;CAClB;AAED,SAAS,EAAqB,IAAU,WAAW,SAAS,iBAAiB;CAC3E,IAAM,IAAgB,iBAAiB,EAAQ;AAE/C,QAAO;EACL,OAAO,EAAc,iBAAiB,kCAAkC,KAAK;EAC7E,MAAM,EAAc,iBAAiB,iCAAiC,KAAK;EAC3E,iBAAiB,EAAc,iBAAiB,0CAA0C,KAAK;EAC/F,SAAS,EAAc,iBAAiB,6BAA6B,KAAK;EAC1E,kBAAkB,EAAc,iBAAiB,8BAA8B,KAAK;EACrF;;AA6BI,IAAA,IAAA,cAA+B,EAA2D,EAAW,CAAC;CAC3G,KAAwC,IAAI,EAAqB,KAAK;;gBAOtD,EAAU,CAAC,EAAO,CAAC;;;kBAER;GACzB,KAAK;GACL,SAAS;GACT,aAAa;IACX,MAAM;IACN,YAAY;KACV,gBAAgB,EAAE,MAAM,UAAmB;KAC3C,OAAO,EAAE,MAAM,UAAmB;KAClC,kBAAkB,EAAE,MAAM,WAAA;;;GAG/B;;;4BAE2B;IACzB,EAAQ,SAAS,MAAM;IACvB,EAAQ,SAAS,MAAM;IACvB,EAAK,SAAS,MAAM;IACpB,EAAK,SAAS,MAAM;IACpB,EAAS,SAAS,MAAM;IACxB,EAAO,SAAS,MAAM;GACxB;;
|
|
1
|
+
{"version":3,"file":"preferences-input2.js","names":["#setColorScheme","#setScale","#setReducedMotion","#i18nController","#updatePreferences","#update"],"sources":["../../src/preferences-input/preferences-input.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, isServer, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { I18nController, scopedRegistry, useStyles } from '@nvidia-elements/core/internal';\nimport { state } from 'lit/decorators/state.js';\nimport { FormControlMixin } from '@nvidia-elements/forms/mixin';\nimport { type IconName, Icon } from '@nvidia-elements/core/icon';\nimport { Control } from '@nvidia-elements/core/forms';\nimport { Divider } from '@nvidia-elements/core/divider';\nimport { Menu, MenuItem } from '@nvidia-elements/core/menu';\nimport { Switch } from '@nvidia-elements/core/switch';\nimport styles from './preferences-input.css?inline';\n\nexport type ColorScheme = 'auto' | 'light' | 'dark' | 'high-contrast';\nexport type Scale = 'default' | 'compact' | 'relaxed';\nexport type Variant = 'reduced-motion';\n\nconst colorSchemes: ColorScheme[] = ['auto', 'light', 'dark', 'high-contrast'];\nconst scales: Scale[] = ['default', 'compact'];\nconst colorSchemesIcons = {\n auto: 'computer',\n light: 'sun',\n dark: 'moon',\n 'high-contrast': 'circle-half'\n} satisfies Record<ColorScheme, IconName>;\n\nfunction getActivePreferences(element = globalThis.document.documentElement) {\n const computedStyle = getComputedStyle(element);\n\n return {\n light: computedStyle.getPropertyValue('--nve-config-color-scheme-light') === 'true',\n dark: computedStyle.getPropertyValue('--nve-config-color-scheme-dark') === 'true',\n 'high-contrast': computedStyle.getPropertyValue('--nve-config-color-scheme-high-contrast') === 'true',\n compact: computedStyle.getPropertyValue('--nve-config-scale-compact') === 'true',\n 'reduced-motion': computedStyle.getPropertyValue('--nve-config-reduced-motion') === 'true'\n } satisfies Partial<Record<ColorScheme | Scale | Variant, boolean>>;\n}\n\nexport interface PreferencesInputValue {\n 'color-scheme'?: ColorScheme | string;\n scale?: Scale | string;\n 'reduced-motion'?: boolean;\n}\n\n/**\n * @element nve-preferences-input\n * @description A preferences input is a widget for controlling apperance. Stylesheets register to the preferences input by including a css-property, see Standard for an example.\n * @since 1.23.7\n * @entrypoint \\@nvidia-elements/core/preferences-input\n * @event input - Dispatched when the value has changed\n * @event change - Dispatched when the value has changed\n * @cssprop --color\n * @cssprop --width\n * @csspart control - The control wrapper elements that contain the labels and menus\n * @csspart menu - The menu elements that display color scheme and scale options\n * @csspart menu-item - The individual menu item elements for each selectable option\n * @csspart icon - The icon element displayed next to color scheme options\n * @csspart divider - The divider elements that separate preference sections\n * @csspart switch - The switch element for the reduced motion toggle\n *\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/listbox/\n *\n */\n@scopedRegistry()\nexport class PreferencesInput extends FormControlMixin<typeof LitElement, PreferencesInputValue>(LitElement) {\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n /**\n * Enables updating internal string values for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-preferences-input',\n version: '0.0.0',\n valueSchema: {\n type: 'object' as const,\n properties: {\n 'color-scheme': { type: 'string' as const },\n scale: { type: 'string' as const },\n 'reduced-motion': { type: 'boolean' as const }\n }\n }\n };\n\n static elementDefinitions = {\n [Control.metadata.tag]: Control,\n [Divider.metadata.tag]: Divider,\n [Icon.metadata.tag]: Icon,\n [Menu.metadata.tag]: Menu,\n [MenuItem.metadata.tag]: MenuItem,\n [Switch.metadata.tag]: Switch\n };\n\n @state() private activePreferences: ReturnType<typeof getActivePreferences> = {\n light: false,\n dark: false,\n 'high-contrast': false,\n compact: false,\n 'reduced-motion': false\n };\n\n // eslint-disable-next-line max-lines-per-function\n render() {\n return html`\n <div internal-host>\n <nve-control part=\"control\">\n <label>${this.i18n.colorScheme}</label>\n <nve-menu part=\"menu\" nve-control>\n ${colorSchemes.map(\n value => html`\n <nve-menu-item part=\"menu-item\"\n .selected=${this.value?.['color-scheme'] === value}\n .value=${value}\n @click=${() => this.#setColorScheme(value)}\n >\n <nve-icon part=\"icon\" name=${colorSchemesIcons[value]}></nve-icon> ${value}\n </nve-menu-item>\n `\n )}\n </nve-menu>\n </nve-control>\n ${\n this.activePreferences['compact']\n ? html`\n <nve-divider part=\"divider\"></nve-divider>\n <nve-control part=\"control\">\n <label>${this.i18n.scale}</label>\n <nve-menu part=\"menu\" nve-control>\n ${scales.map(\n value => html`\n <nve-menu-item part=\"menu-item\"\n .selected=${this.value?.['scale'] === value}\n .value=${value}\n @click=${() => this.#setScale(value)}\n >\n ${value}\n </nve-menu-item>\n `\n )}\n </nve-menu>\n </nve-control>\n `\n : ''\n }\n ${\n this.activePreferences['reduced-motion']\n ? html`\n <nve-divider part=\"divider\"></nve-divider>\n <nve-switch part=\"switch\">\n <label>${this.i18n.reducedMotion}</label>\n <input\n type=\"checkbox\"\n value=\"reduced-motion\"\n .checked=${this.value?.['reduced-motion']}\n @change=${(e: { target: HTMLInputElement }) => this.#setReducedMotion(e.target.checked)}\n />\n </nve-switch>`\n : ''\n }\n </div>\n `;\n }\n\n constructor() {\n super();\n this.value = {\n 'color-scheme': 'auto',\n 'reduced-motion': false,\n scale: 'default'\n };\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('nve-control', '');\n this.#updatePreferences();\n }\n\n /** @private */\n updateValue(value: PreferencesInputValue) {\n super.updateValue({ ...this.value, ...value });\n this.#updatePreferences();\n }\n\n #updatePreferences() {\n if (!isServer) {\n const preferences = getActivePreferences();\n if (JSON.stringify(this.activePreferences) !== JSON.stringify(preferences)) {\n this.activePreferences = preferences;\n }\n }\n }\n\n #setColorScheme(value: ColorScheme) {\n this.value = { ...this.value, 'color-scheme': value };\n this.#update();\n }\n\n #setScale(value: Scale) {\n this.value = { ...this.value, scale: value };\n this.#update();\n }\n\n #setReducedMotion(value: boolean) {\n this.value = { ...this.value, 'reduced-motion': value };\n this.#update();\n }\n\n #update() {\n this.dispatchInputEvent();\n this.dispatchChangeEvent();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAM,IAA8B;CAAC;CAAQ;CAAS;CAAQ;CAAgB,EACxE,IAAkB,CAAC,WAAW,UAAU,EACxC,IAAoB;CACxB,MAAM;CACN,OAAO;CACP,MAAM;CACN,iBAAiB;CAClB;AAED,SAAS,EAAqB,IAAU,WAAW,SAAS,iBAAiB;CAC3E,IAAM,IAAgB,iBAAiB,EAAQ;AAE/C,QAAO;EACL,OAAO,EAAc,iBAAiB,kCAAkC,KAAK;EAC7E,MAAM,EAAc,iBAAiB,iCAAiC,KAAK;EAC3E,iBAAiB,EAAc,iBAAiB,0CAA0C,KAAK;EAC/F,SAAS,EAAc,iBAAiB,6BAA6B,KAAK;EAC1E,kBAAkB,EAAc,iBAAiB,8BAA8B,KAAK;EACrF;;AA6BI,IAAA,IAAA,cAA+B,EAA2D,EAAW,CAAC;CAC3G,KAAwC,IAAI,EAAqB,KAAK;;gBAOtD,EAAU,CAAC,EAAO,CAAC;;;kBAER;GACzB,KAAK;GACL,SAAS;GACT,aAAa;IACX,MAAM;IACN,YAAY;KACV,gBAAgB,EAAE,MAAM,UAAmB;KAC3C,OAAO,EAAE,MAAM,UAAmB;KAClC,kBAAkB,EAAE,MAAM,WAAA;;;GAG/B;;;4BAE2B;IACzB,EAAQ,SAAS,MAAM;IACvB,EAAQ,SAAS,MAAM;IACvB,EAAK,SAAS,MAAM;IACpB,EAAK,SAAS,MAAM;IACpB,EAAS,SAAS,MAAM;IACxB,EAAO,SAAS,MAAM;GACxB;;CAWD,SAAS;AACP,SAAO,CAAI,yDAGI,KAAK,KAAK,YAAY,4CAE7B,EAAa,KACb,MAAS,CAAI,8CAEC,KAAK,QAAQ,oBAAoB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EhC,EADA,KAAK,QAAQ;GAAE,GAAG,KAAK;GAAO,kBAAkB;GAAO,EACvD,MAAA,GAAc;;CAGhB,KAAU;AAER,EADA,KAAK,oBAAoB,EACzB,KAAK,qBAAqB;;;GA/I3B,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KA0B1B,GAAO,CAAA,EAAA,EAAA,WAAA,qBAAA,KAAA,EAAA,SAjCT,GAAgB,CAAA,EAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.examples.js","names":[],"sources":["../../src/progress-bar/progress-bar.examples.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html } from 'lit';\nimport '@nvidia-elements/core/progress-bar/define.js';\n\nexport default {\n title: 'Elements/Progress Bar',\n component: 'nve-progress-bar',\n};\n\n/**\n * @summary Standard progress bar for representing completion levels from 0% to 100% for task tracking.\n */\nexport const Default = {\n render: () => html`\n<nve-progress-bar value=\"50\"></nve-progress-bar>`\n};\n\n/**\n * @summary Progress bars with different status colors showing completion levels from 0% to 100% for task tracking.\n * @tags test-case\n */\nexport const Status = {\n render: () => html`\n<div nve-layout=\"column gap:md pad:lg full\">\n <nve-progress-bar value=\"0\"></nve-progress-bar>\n <nve-progress-bar value=\"10\"></nve-progress-bar>\n <nve-progress-bar status=\"accent\" value=\"25\"></nve-progress-bar>\n <nve-progress-bar status=\"success\" value=\"50\"></nve-progress-bar>\n <nve-progress-bar status=\"warning\" value=\"75\"></nve-progress-bar>\n <nve-progress-bar status=\"danger\" value=\"100\"></nve-progress-bar>\n</div>`\n};\n\n/**\n * @summary Progress bars with custom max values for representing non-percentage based progress like file counts or steps.\n * @tags test-case\n */\nexport const Max = {\n render: () => html`\n<div nve-layout=\"column gap:md pad:lg full\">\n <nve-progress-bar status=\"accent\" value=\"25\" max=\"50\"></nve-progress-bar>\n <nve-progress-bar status=\"accent\" value=\"45\" max=\"50\"></nve-progress-bar>\n</div>\n `\n};\n\n/**\n * @summary Use a labeled progress bar with percentage display to communicate upload or task status.\n * @tags pattern\n */\nexport const Labeled = {\n render: () => html`\n<div nve-layout=\"column gap:
|
|
1
|
+
{"version":3,"file":"progress-bar.examples.js","names":[],"sources":["../../src/progress-bar/progress-bar.examples.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html } from 'lit';\nimport '@nvidia-elements/core/progress-bar/define.js';\n\nexport default {\n title: 'Elements/Progress Bar',\n component: 'nve-progress-bar',\n};\n\n/**\n * @summary Standard progress bar for representing completion levels from 0% to 100% for task tracking.\n */\nexport const Default = {\n render: () => html`\n<nve-progress-bar value=\"50\"></nve-progress-bar>`\n};\n\n/**\n * @summary Progress bars with different status colors showing completion levels from 0% to 100% for task tracking.\n * @tags test-case\n */\nexport const Status = {\n render: () => html`\n<div nve-layout=\"column gap:md pad:lg full\">\n <nve-progress-bar value=\"0\"></nve-progress-bar>\n <nve-progress-bar value=\"10\"></nve-progress-bar>\n <nve-progress-bar status=\"accent\" value=\"25\"></nve-progress-bar>\n <nve-progress-bar status=\"success\" value=\"50\"></nve-progress-bar>\n <nve-progress-bar status=\"warning\" value=\"75\"></nve-progress-bar>\n <nve-progress-bar status=\"danger\" value=\"100\"></nve-progress-bar>\n</div>`\n};\n\n/**\n * @summary Progress bars with custom max values for representing non-percentage based progress like file counts or steps.\n * @tags test-case\n */\nexport const Max = {\n render: () => html`\n<div nve-layout=\"column gap:md pad:lg full\">\n <nve-progress-bar status=\"accent\" value=\"25\" max=\"50\"></nve-progress-bar>\n <nve-progress-bar status=\"accent\" value=\"45\" max=\"50\"></nve-progress-bar>\n</div>\n `\n};\n\n/**\n * @summary Use a labeled progress bar with percentage display to communicate upload or task status.\n * @tags pattern\n */\nexport const Labeled = {\n render: () => html`\n<div nve-layout=\"column gap:xs pad:lg align:horizontal-stretch full\">\n <div nve-layout=\"row align:space-between\">\n <p nve-text=\"label sm\">Upload Status</p>\n <p nve-text=\"label emphasis sm\">80%</p>\n </div>\n <nve-progress-bar status=\"accent\" value=\"80\"></nve-progress-bar>\n</div>\n `\n};\n\n/**\n * @summary Indeterminate progress bar for showing activity when completion time is unknown, like loading or processing.\n */\nexport const Indeterminate = {\n render: () => html`\n<nve-progress-bar></nve-progress-bar>`\n};\n\n/**\n * @summary Progress bars display as an animated loading indicator when no `value` attribute exists.\n * @tags test-case\n */\nexport const IndeterminateStatusColors = {\n render: () => html`\n<div nve-layout=\"column gap:md full\">\n <nve-progress-bar status=\"accent\"></nve-progress-bar>\n <nve-progress-bar status=\"warning\"></nve-progress-bar>\n <nve-progress-bar status=\"danger\"></nve-progress-bar>\n</div>`\n};\n\n/**\n * @summary Indeterminate progress bar with custom color, height, and opacity for brand-specific styling and visual emphasis.\n * @tags test-case\n */\nexport const IndeterminateCustomColor = {\n render: () => html`\n<nve-progress-bar style=\"--accent-color: var(--nve-sys-accent-primary-background); --height: var(--nve-ref-size-150); --opacity: 1;\"></nve-progress-bar>`\n};\n\n/**\n * @summary Progress bars with custom heights for different visual prominence levels and layout requirements.\n * @tags test-case\n * @description The progress bar's height accepts customization through the `--height` CSS custom property. This allows you to create progress bars that match your application's visual hierarchy and emphasis needs. For consistency and theming, use design system tokens, but any value that suits your layout also works.\n */\nexport const CustomHeights = {\n render: () => html`\n<div nve-layout=\"column gap:md full\">\n <nve-progress-bar style=\"--height: var(--nve-ref-size-100);\"></nve-progress-bar>\n <nve-progress-bar style=\"--height: var(--nve-ref-size-200);\"></nve-progress-bar>\n <nve-progress-bar style=\"--height: var(--nve-ref-size-300);\"></nve-progress-bar>\n</div>`\n};\n"],"mappings":";AAGA,IAAA,IAAS"}
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
{
|
|
37
37
|
"id": "core-progress-bar_labeled",
|
|
38
38
|
"name": "Labeled",
|
|
39
|
-
"template": "<div nve-layout=\"column gap:
|
|
39
|
+
"template": "<div nve-layout=\"column gap:xs pad:lg align:horizontal-stretch full\">\n <div nve-layout=\"row align:space-between\">\n <p nve-text=\"label sm\">Upload Status</p>\n <p nve-text=\"label emphasis sm\">80%</p>\n </div>\n <nve-progress-bar status=\"accent\" value=\"80\"></nve-progress-bar>\n</div>\n",
|
|
40
40
|
"summary": "Use a labeled progress bar with percentage display to communicate upload or task status.",
|
|
41
41
|
"description": "",
|
|
42
42
|
"composition": false,
|
package/dist/pulse/pulse2.js
CHANGED
package/dist/radio/radio2.js
CHANGED
package/dist/range/range2.js
CHANGED