@ds-mo/ui 12.5.0 → 12.6.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/.build-stamp +1 -1
- package/dist/agent-patterns.json +21 -12
- package/dist/agent.json +1536 -1424
- package/dist/angular/ds-bar-workflow.d.ts +1 -1
- package/dist/angular/ds-bar-workflow.js +3 -3
- package/dist/angular/ds-mobile-bar-nav.d.ts +18 -0
- package/dist/angular/{ds-shell-mobile-bar.js → ds-mobile-bar-nav.js} +15 -15
- package/dist/angular/ds-mobile-header.d.ts +23 -0
- package/dist/angular/ds-mobile-header.js +45 -0
- package/dist/angular/ds-mobile-section-switcher.d.ts +18 -0
- package/dist/angular/{ds-shell-mobile-section-nav.js → ds-mobile-section-switcher.js} +15 -15
- package/dist/angular/ds-mobile-sheet-nav.d.ts +20 -0
- package/dist/angular/{ds-shell-mobile-nav.js → ds-mobile-sheet-nav.js} +13 -16
- package/dist/angular/ds-shell-app.d.ts +1 -1
- package/dist/angular/ds-shell-app.js +3 -3
- package/dist/angular/ds-shell-page.d.ts +1 -1
- package/dist/angular/ds-shell-page.js +3 -3
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +4 -3
- package/dist/angular/proxies.d.ts +4 -3
- package/dist/angular/proxies.js +4 -3
- package/dist/components/ds-agent-activity.js +1 -1
- package/dist/components/ds-agent-response.js +1 -1
- package/dist/components/ds-agent-tool-call.js +1 -1
- package/dist/components/ds-avatar.js +1 -1
- package/dist/components/ds-avatar.js.map +1 -1
- package/dist/components/ds-badge.js +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-nav.js.map +1 -1
- package/dist/components/ds-bar-title.js +1 -1
- package/dist/components/ds-bar-title.js.map +1 -1
- package/dist/components/ds-bar-workflow.js +1 -1
- package/dist/components/ds-bar-workflow.js.map +1 -1
- package/dist/components/ds-breadcrumb.js +1 -1
- package/dist/components/ds-button-filled.js +1 -1
- package/dist/components/ds-button-unfilled.js +1 -1
- package/dist/components/ds-card-data-viz-bar.js +1 -1
- package/dist/components/ds-card-data-viz-donut.js +1 -1
- package/dist/components/ds-card-data-viz-line.js +1 -1
- package/dist/components/ds-card-setting.js +1 -1
- package/dist/components/ds-chart-bar.js +1 -1
- package/dist/components/ds-chart-donut.js +1 -1
- package/dist/components/ds-chart-legend.js +1 -1
- package/dist/components/ds-chart-legend.js.map +1 -1
- package/dist/components/ds-chart-line.js +1 -1
- package/dist/components/ds-checkbox.js +1 -1
- package/dist/components/ds-chip.js +1 -1
- package/dist/components/ds-chip.js.map +1 -1
- package/dist/components/ds-code-block.js +1 -1
- package/dist/components/ds-conversation-list-item.js +1 -1
- package/dist/components/ds-conversation-list-item.js.map +1 -1
- package/dist/components/ds-conversation-list-section.js +1 -1
- package/dist/components/ds-empty-state.js +1 -1
- package/dist/components/ds-field.js +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-input.js.map +1 -1
- package/dist/components/ds-loader.js +1 -1
- package/dist/components/ds-markdown.js +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-message-composer.js +1 -1
- package/dist/components/ds-message-composer.js.map +1 -1
- package/dist/components/ds-message-scroller.js +1 -1
- package/dist/components/ds-message.js +1 -1
- package/dist/components/{ds-shell-mobile-nav.d.ts → ds-mobile-bar-nav.d.ts} +4 -4
- package/dist/components/ds-mobile-bar-nav.js +2 -0
- package/dist/components/ds-mobile-bar-nav.js.map +1 -0
- package/dist/components/ds-mobile-header.d.ts +11 -0
- package/dist/components/ds-mobile-header.js +2 -0
- package/dist/components/ds-mobile-header.js.map +1 -0
- package/dist/components/ds-mobile-section-switcher.d.ts +11 -0
- package/dist/components/ds-mobile-section-switcher.js +2 -0
- package/dist/components/ds-mobile-section-switcher.js.map +1 -0
- package/dist/components/{ds-shell-mobile-bar.d.ts → ds-mobile-sheet-nav.d.ts} +4 -4
- package/dist/components/ds-mobile-sheet-nav.js +2 -0
- package/dist/components/ds-mobile-sheet-nav.js.map +1 -0
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-modal.js.map +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-nav.js.map +1 -1
- package/dist/components/ds-panel-sub-nav.js +1 -1
- package/dist/components/ds-panel-sub-nav.js.map +1 -1
- package/dist/components/ds-panel-tool-header.js +1 -1
- package/dist/components/ds-panel-tool-search.js +1 -1
- package/dist/components/ds-panel-tool-search.js.map +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-radio.js +1 -1
- package/dist/components/ds-radio.js.map +1 -1
- package/dist/components/ds-select-multi.js +1 -1
- package/dist/components/ds-select-multi.js.map +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-select.js.map +1 -1
- package/dist/components/ds-shell-app.js +1 -1
- package/dist/components/ds-shell-app.js.map +1 -1
- package/dist/components/ds-shell-gradient-picker.js +1 -1
- package/dist/components/ds-shell-gradient-picker.js.map +1 -1
- package/dist/components/ds-shell-gradient-swatch.js +1 -1
- package/dist/components/ds-shell-page.js +1 -1
- package/dist/components/ds-shell-page.js.map +1 -1
- package/dist/components/ds-shell-tools.js +1 -1
- package/dist/components/ds-shell-tools.js.map +1 -1
- package/dist/components/ds-skeleton.js +1 -1
- package/dist/components/ds-skeleton.js.map +1 -1
- package/dist/components/ds-swatch-picker.js +1 -1
- package/dist/components/ds-switch.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-tag.js +1 -1
- package/dist/components/ds-tag.js.map +1 -1
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/ds-toast.js.map +1 -1
- package/dist/components/ds-tooltip-data-viz.js +1 -1
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/ds-typing-indicator.js +1 -1
- package/dist/components/p--bSkr_yn.js +2 -0
- package/dist/components/p--bSkr_yn.js.map +1 -0
- package/dist/components/p-46nk9-RO.js +2 -0
- package/dist/components/p-46nk9-RO.js.map +1 -0
- package/dist/components/{p-9dQQSgwT.js → p-BHYrsGBw.js} +2 -2
- package/dist/components/p-BY0PzkUp.js +2 -0
- package/dist/components/p-BgGP65Nn.js +2 -0
- package/dist/components/p-BgGP65Nn.js.map +1 -0
- package/dist/components/p-BkAMkjIR.js +2 -0
- package/dist/components/{p-Co8hD3P-.js.map → p-BkAMkjIR.js.map} +1 -1
- package/dist/components/p-BrusnEYP.js.map +1 -1
- package/dist/components/p-C2ym_Ich.js +2 -0
- package/dist/components/{p-Biz6xo-z.js → p-CFpWrYAH.js} +2 -2
- package/dist/components/p-CICGtu7H.js +2 -0
- package/dist/components/{p-CtD24EyI.js.map → p-CICGtu7H.js.map} +1 -1
- package/dist/components/p-CLzlL3G4.js +2 -0
- package/dist/components/p-CLzlL3G4.js.map +1 -0
- package/dist/components/p-CXcjwduV.js +2 -0
- package/dist/components/{p-BhxwpOH8.js.map → p-CXcjwduV.js.map} +1 -1
- package/dist/components/p-Ca-I2UnB.js +2 -0
- package/dist/components/p-Ca-I2UnB.js.map +1 -0
- package/dist/components/p-CaRyxTMz.js +2 -0
- package/dist/components/p-CaRyxTMz.js.map +1 -0
- package/dist/components/{p-g40DTeV8.js → p-CvKKmZJj.js} +2 -2
- package/dist/components/p-D4o2D1hk.js +2 -0
- package/dist/components/p-D4o2D1hk.js.map +1 -0
- package/dist/components/{p-DXnFhmZF.js → p-D9iN80yX.js} +2 -2
- package/dist/components/p-DD1Lgs7O.js +2 -0
- package/dist/components/p-DD1Lgs7O.js.map +1 -0
- package/dist/components/{p-DjPZxzIG.js → p-DQDpDYyF.js} +2 -2
- package/dist/components/p-DTea1Du7.js +2 -0
- package/dist/components/p-DTea1Du7.js.map +1 -0
- package/dist/components/p-DWdRSOBV.js +2 -0
- package/dist/components/{p-BPS9VExm.js.map → p-DWdRSOBV.js.map} +1 -1
- package/dist/components/p-DcFfilOX.js +2 -0
- package/dist/components/p-DcFfilOX.js.map +1 -0
- package/dist/components/p-Dg3xLna0.js +2 -0
- package/dist/components/{p-C_0Q8Cnp.js.map → p-Dg3xLna0.js.map} +1 -1
- package/dist/components/p-DvVW0hxm.js +2 -0
- package/dist/components/p-DvVW0hxm.js.map +1 -0
- package/dist/components/p-YtgcuJYx.js +2 -0
- package/dist/components/{p-PZ6R_nGI.js.map → p-YtgcuJYx.js.map} +1 -1
- package/dist/components/p-loq_--ce.js +2 -0
- package/dist/components/{p-NUNsefU1.js.map → p-loq_--ce.js.map} +1 -1
- package/dist/docs/components.json +3586 -3064
- package/dist/lib/shell/index.d.ts +1 -1
- package/dist/lib/shell/index.js +2 -1
- package/dist/lib/shell/index.js.map +2 -2
- package/dist/lib/shell/shell-responsive.d.ts +3 -3
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/index.js +8 -0
- package/dist/lib/utils/index.js.map +3 -3
- package/dist/lib/utils/required-validity.d.ts +14 -0
- package/dist/mcp-data/registry/agent-activity.json +2 -2
- package/dist/mcp-data/registry/badge.json +2 -2
- package/dist/mcp-data/registry/bar-nav.json +2 -2
- package/dist/mcp-data/registry/bar-title.json +2 -2
- package/dist/mcp-data/registry/bar-workflow.json +25 -4
- package/dist/mcp-data/registry/breadcrumb.json +2 -2
- package/dist/mcp-data/registry/button-unfilled.json +3 -3
- package/dist/mcp-data/registry/chart-legend.json +1 -1
- package/dist/mcp-data/registry/checkbox.json +1 -1
- package/dist/mcp-data/registry/conversation-list-item.json +2 -2
- package/dist/mcp-data/registry/input.json +1 -1
- package/dist/mcp-data/registry/loader.json +2 -2
- package/dist/mcp-data/registry/mobile-bar-nav.json +333 -0
- package/dist/mcp-data/registry/mobile-header.json +351 -0
- package/dist/mcp-data/registry/mobile-section-switcher.json +210 -0
- package/dist/mcp-data/registry/mobile-sheet-nav.json +317 -0
- package/dist/mcp-data/registry/panel-nav.json +2 -2
- package/dist/mcp-data/registry/panel-tools.json +2 -2
- package/dist/mcp-data/registry/radio.json +1 -1
- package/dist/mcp-data/registry/registry.json +1544 -1429
- package/dist/mcp-data/registry/select-multi.json +1 -1
- package/dist/mcp-data/registry/select.json +2 -2
- package/dist/mcp-data/registry/shell-app.json +17 -17
- package/dist/mcp-data/registry/shell-page.json +26 -7
- package/dist/mcp-data/registry/shell-tools.json +10 -7
- package/dist/mcp-data/registry/switch.json +1 -1
- package/dist/mcp-data/registry/toast.json +2 -2
- package/dist/react/components.d.ts +4 -3
- package/dist/react/components.js +4 -3
- package/dist/react/ds-mobile-bar-nav.d.ts +13 -0
- package/dist/react/ds-mobile-bar-nav.js +15 -0
- package/dist/react/ds-mobile-header.d.ts +13 -0
- package/dist/react/ds-mobile-header.js +15 -0
- package/dist/react/ds-mobile-section-switcher.d.ts +12 -0
- package/dist/react/ds-mobile-section-switcher.js +12 -0
- package/dist/react/ds-mobile-sheet-nav.d.ts +14 -0
- package/dist/react/ds-mobile-sheet-nav.js +16 -0
- package/dist/types/components/BarWorkflow/BarWorkflow.d.ts +6 -0
- package/dist/types/components/ButtonUnfilled/ButtonUnfilled.d.ts +1 -1
- package/dist/types/components/MobileBarNav/MobileBarNav.d.ts +26 -0
- package/dist/types/components/MobileBarNav/index.d.ts +4 -0
- package/dist/types/components/MobileBarNav/mobile-bar-nav-types.d.ts +5 -0
- package/dist/types/components/MobileHeader/MobileHeader.d.ts +39 -0
- package/dist/types/components/MobileHeader/index.d.ts +2 -0
- package/dist/types/components/MobileHeader/mobile-header-types.d.ts +5 -0
- package/dist/types/components/MobileSectionSwitcher/MobileSectionSwitcher.d.ts +35 -0
- package/dist/types/components/MobileSectionSwitcher/index.d.ts +3 -0
- package/dist/types/components/MobileSectionSwitcher/mobile-section-switcher-types.d.ts +4 -0
- package/dist/types/components/MobileSectionSwitcher/mobile-section-switcher-utils.d.ts +10 -0
- package/dist/types/components/{ShellMobileNav/ShellMobileNav.d.ts → MobileSheetNav/MobileSheetNav.d.ts} +5 -7
- package/dist/types/components/MobileSheetNav/index.d.ts +1 -0
- package/dist/types/components/ShellApp/ShellApp.d.ts +4 -4
- package/dist/types/components/ShellPage/ShellPage.d.ts +4 -0
- package/dist/types/components.d.ts +530 -381
- package/dist/types/shell/index.d.ts +1 -1
- package/dist/types/shell/shell-responsive.d.ts +3 -3
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/required-validity.d.ts +15 -0
- package/package.json +1 -1
- package/dist/angular/ds-shell-mobile-bar.d.ts +0 -18
- package/dist/angular/ds-shell-mobile-nav.d.ts +0 -23
- package/dist/angular/ds-shell-mobile-section-nav.d.ts +0 -18
- package/dist/components/ds-shell-mobile-bar.js +0 -2
- package/dist/components/ds-shell-mobile-bar.js.map +0 -1
- package/dist/components/ds-shell-mobile-nav.js +0 -2
- package/dist/components/ds-shell-mobile-nav.js.map +0 -1
- package/dist/components/ds-shell-mobile-section-nav.d.ts +0 -11
- package/dist/components/ds-shell-mobile-section-nav.js +0 -2
- package/dist/components/ds-shell-mobile-section-nav.js.map +0 -1
- package/dist/components/p-B6Vuayt6.js +0 -2
- package/dist/components/p-B6Vuayt6.js.map +0 -1
- package/dist/components/p-BPS9VExm.js +0 -2
- package/dist/components/p-BVV_rlIP.js +0 -2
- package/dist/components/p-BVV_rlIP.js.map +0 -1
- package/dist/components/p-BhxwpOH8.js +0 -2
- package/dist/components/p-BtEjlcB9.js +0 -2
- package/dist/components/p-BtEjlcB9.js.map +0 -1
- package/dist/components/p-CH6cNXXF.js +0 -2
- package/dist/components/p-CH6cNXXF.js.map +0 -1
- package/dist/components/p-C_0Q8Cnp.js +0 -2
- package/dist/components/p-Ce52yVXF.js +0 -2
- package/dist/components/p-Ce52yVXF.js.map +0 -1
- package/dist/components/p-CgHTNfC1.js +0 -2
- package/dist/components/p-CgHTNfC1.js.map +0 -1
- package/dist/components/p-Co8hD3P-.js +0 -2
- package/dist/components/p-CoYFJD-w.js +0 -2
- package/dist/components/p-CoYFJD-w.js.map +0 -1
- package/dist/components/p-Cpr3K41-.js +0 -2
- package/dist/components/p-Cpr3K41-.js.map +0 -1
- package/dist/components/p-CtD24EyI.js +0 -2
- package/dist/components/p-DYqReipj.js +0 -2
- package/dist/components/p-DYqReipj.js.map +0 -1
- package/dist/components/p-NUNsefU1.js +0 -2
- package/dist/components/p-PZ6R_nGI.js +0 -2
- package/dist/components/p-jCWtxthA.js +0 -2
- package/dist/components/p-yhj1lIPx.js +0 -2
- package/dist/mcp-data/registry/shell-mobile-bar.json +0 -314
- package/dist/mcp-data/registry/shell-mobile-nav.json +0 -348
- package/dist/mcp-data/registry/shell-mobile-section-nav.json +0 -267
- package/dist/react/ds-shell-mobile-bar.d.ts +0 -13
- package/dist/react/ds-shell-mobile-bar.js +0 -15
- package/dist/react/ds-shell-mobile-nav.d.ts +0 -15
- package/dist/react/ds-shell-mobile-nav.js +0 -17
- package/dist/react/ds-shell-mobile-section-nav.d.ts +0 -12
- package/dist/react/ds-shell-mobile-section-nav.js +0 -12
- package/dist/types/components/ShellMobileBar/ShellMobileBar.d.ts +0 -25
- package/dist/types/components/ShellMobileBar/index.d.ts +0 -4
- package/dist/types/components/ShellMobileBar/shell-mobile-bar-types.d.ts +0 -5
- package/dist/types/components/ShellMobileNav/index.d.ts +0 -2
- package/dist/types/components/ShellMobileNav/shell-mobile-nav-types.d.ts +0 -6
- package/dist/types/components/ShellMobileSectionNav/ShellMobileSectionNav.d.ts +0 -30
- package/dist/types/components/ShellMobileSectionNav/index.d.ts +0 -2
- /package/dist/components/{p-9dQQSgwT.js.map → p-BHYrsGBw.js.map} +0 -0
- /package/dist/components/{p-jCWtxthA.js.map → p-BY0PzkUp.js.map} +0 -0
- /package/dist/components/{p-yhj1lIPx.js.map → p-C2ym_Ich.js.map} +0 -0
- /package/dist/components/{p-Biz6xo-z.js.map → p-CFpWrYAH.js.map} +0 -0
- /package/dist/components/{p-g40DTeV8.js.map → p-CvKKmZJj.js.map} +0 -0
- /package/dist/components/{p-DXnFhmZF.js.map → p-D9iN80yX.js.map} +0 -0
- /package/dist/components/{p-DjPZxzIG.js.map → p-DQDpDYyF.js.map} +0 -0
|
@@ -354,7 +354,7 @@
|
|
|
354
354
|
},
|
|
355
355
|
{
|
|
356
356
|
"path": "src/wc/components/Checkbox/Checkbox.tsx",
|
|
357
|
-
"content": "import { AttachInternals, Component, Prop, State, Event, EventEmitter, Watch, h, Host } from '@stencil/core';\n\nexport type CheckboxSize = 'md' | 'sm' | 'xs';\n\nconst LABEL_VARIANT: Record<CheckboxSize, 'text-body-medium' | 'text-body-small' | 'text-caption'> = {\n md: 'text-body-medium',\n sm: 'text-body-small',\n xs: 'text-caption',\n};\n\nlet idCounter = 0;\n\n@Component({\n tag: 'ds-checkbox',\n styleUrl: 'Checkbox.css',\n scoped: true,\n formAssociated: true,\n})\nexport class Checkbox {\n @AttachInternals() internals!: ElementInternals;\n private labelId = `ds-checkbox-label-${++idCounter}`;\n\n /** Visible label and accessible name. Omitted only in presentation mode. */\n @Prop() label!: string;\n /** Current checked state. */\n @Prop({ mutable: true }) checked: boolean = false;\n /** Visual and placement density. */\n @Prop() size: CheckboxSize = 'md';\n /** Native form field name. */\n @Prop({ reflect: true }) name: string | undefined;\n /** Submitted value when checked. */\n @Prop() value: string = 'on';\n /** Native disabled state. */\n @Prop({ reflect: true }) disabled: boolean = false;\n /** Require the checkbox to be checked for form validity. */\n @Prop({ reflect: true }) required: boolean = false;\n /** Validation message used when a required checkbox is unchecked. */\n @Prop() requiredMessage: string =
|
|
357
|
+
"content": "import { AttachInternals, Component, Prop, State, Event, EventEmitter, Watch, h, Host } from '@stencil/core';\nimport { DEFAULT_REQUIRED_MESSAGE, setRequiredValidity } from '../../utils';\n\nexport type CheckboxSize = 'md' | 'sm' | 'xs';\n\nconst LABEL_VARIANT: Record<CheckboxSize, 'text-body-medium' | 'text-body-small' | 'text-caption'> = {\n md: 'text-body-medium',\n sm: 'text-body-small',\n xs: 'text-caption',\n};\n\nlet idCounter = 0;\n\n@Component({\n tag: 'ds-checkbox',\n styleUrl: 'Checkbox.css',\n scoped: true,\n formAssociated: true,\n})\nexport class Checkbox {\n @AttachInternals() internals!: ElementInternals;\n private labelId = `ds-checkbox-label-${++idCounter}`;\n\n /** Visible label and accessible name. Omitted only in presentation mode. */\n @Prop() label!: string;\n /** Current checked state. */\n @Prop({ mutable: true }) checked: boolean = false;\n /** Visual and placement density. */\n @Prop() size: CheckboxSize = 'md';\n /** Native form field name. */\n @Prop({ reflect: true }) name: string | undefined;\n /** Submitted value when checked. */\n @Prop() value: string = 'on';\n /** Native disabled state. */\n @Prop({ reflect: true }) disabled: boolean = false;\n /** Require the checkbox to be checked for form validity. */\n @Prop({ reflect: true }) required: boolean = false;\n /** Validation message used when a required checkbox is unchecked. */\n @Prop() requiredMessage: string = DEFAULT_REQUIRED_MESSAGE;\n /** Mixed visual state. Activation clears it before toggling checked. */\n @Prop({ mutable: true }) indeterminate: boolean = false;\n /** Design-system inactive state. */\n @Prop() isInactive: boolean = false;\n /** Visual-only indicator for a composite control that owns selection semantics. */\n @Prop() presentation: boolean = false;\n\n /** Emitted after user activation with the new checked state. */\n @Event() dsChange!: EventEmitter<boolean>;\n\n private initialChecked = false;\n private initialIndeterminate = false;\n @State() private formDisabled = false;\n\n componentWillLoad() {\n this.initialChecked = this.checked;\n this.initialIndeterminate = this.indeterminate;\n this.syncFormValue();\n }\n\n @Watch('checked')\n @Watch('value')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('required')\n @Watch('presentation')\n syncFormValue() {\n const inactive = this.isInactive || this.disabled || this.formDisabled || this.presentation;\n this.internals.setFormValue(!inactive && this.checked ? this.value : null);\n const missing = this.required && !inactive && !this.checked;\n setRequiredValidity(this.internals, missing, this.requiredMessage);\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.checked = this.initialChecked;\n this.indeterminate = this.initialIndeterminate;\n }\n\n private handleActivate = () => {\n if (this.isInactive || this.disabled || this.formDisabled || this.presentation) return;\n if (this.indeterminate) this.indeterminate = false;\n this.checked = !this.checked;\n this.dsChange.emit(this.checked);\n };\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this.handleActivate();\n }\n };\n\n render() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n const isMarked = this.checked || this.indeterminate;\n const invalid = this.required && !inactive && !this.checked;\n\n return (\n <Host\n role={this.presentation ? undefined : 'checkbox'}\n aria-checked={this.presentation ? undefined : this.indeterminate ? 'mixed' : String(this.checked)}\n aria-disabled={!this.presentation && inactive ? 'true' : undefined}\n aria-required={!this.presentation && this.required ? 'true' : undefined}\n aria-invalid={!this.presentation && invalid ? 'true' : undefined}\n aria-labelledby={this.presentation ? undefined : this.labelId}\n aria-hidden={this.presentation ? 'true' : undefined}\n tabIndex={this.presentation || inactive ? -1 : 0}\n class={{\n checkbox: true,\n 'checkbox--presentation': this.presentation,\n [`checkbox--${this.size}`]: true,\n [`ds-control--${this.size}`]: true,\n 'ds-control-inactive': inactive && !this.presentation,\n 'ds-focus-ring-inset': !this.presentation,\n 'ds-interaction-fill': !inactive && !this.presentation,\n }}\n onClick={this.presentation ? undefined : this.handleActivate}\n onKeyDown={this.presentation ? undefined : this.handleKeyDown}\n >\n <span class=\"checkbox__placement ds-interaction-fill__content\" aria-hidden=\"true\">\n <span class={{ box: true, 'box--marked': isMarked }}>\n {isMarked && (\n // eslint-disable-next-line local/prefer-ds-icon -- Checkbox owns this density-specific state mark and its optical stroke.\n <svg\n class={{\n checkbox__mark: true,\n 'checkbox__mark--checked': !this.indeterminate,\n }}\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n focusable=\"false\"\n >\n <path\n d={this.indeterminate ? 'M4 8H12' : 'M3.5 8.25L6.75 11.5L12.5 4.75'}\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </span>\n </span>\n {!this.presentation && (\n <ds-text\n class=\"checkbox__label ds-interaction-fill__content\"\n as=\"span\"\n variant={LABEL_VARIANT[this.size]}\n textId={this.labelId}\n >\n {this.label}\n </ds-text>\n )}\n </Host>\n );\n }\n}\n",
|
|
358
358
|
"type": "registry:ui"
|
|
359
359
|
}
|
|
360
360
|
]
|
|
@@ -272,12 +272,12 @@
|
|
|
272
272
|
"files": [
|
|
273
273
|
{
|
|
274
274
|
"path": "src/wc/components/ConversationListItem/ConversationListItem.css",
|
|
275
|
-
"content": "@import '../../utils/choice-list.css';\n@import '../../styles/control-elevation.css';\n\n:host {\n display: block;\n box-sizing: border-box;\n -webkit-user-select: none;\n user-select: none;\n}\n\n:host(:hover),\n:host(:focus-within),\n:host(.conversation-list-item--actions-open) {\n position: relative;\n z-index: var(--dimension-z-index-floating);\n}\n\n.conversation-list-item__row {\n position: relative;\n isolation: isolate;\n}\n\n.conversation-list-item {\n color: var(--color-foreground-primary);\n}\n\n.conversation-list-item--error {\n --ds-interaction-border-width: var(--dimension-stroke-width-012);\n --ds-interaction-border-color: var(--color-border-bold-negative);\n}\n\n.conversation-list-item__leading:empty,\n.conversation-list-item__trailing:empty {\n display: none;\n}\n\n.conversation-list-item__leading,\n.conversation-list-item__trailing,\n.conversation-list-item__preview-row {\n display: flex;\n align-items: center;\n}\n\n.conversation-list-item__leading {\n align-self: center;\n width: auto;\n height: auto;\n margin-inline-start: var(--ds-control-label-inset, var(--dimension-space-025));\n margin-inline-end: var(--dimension-space-050);\n}\n\n.conversation-list-item__content {\n min-width: 0;\n}\n\n.conversation-list-item__title-row {\n display: flex;\n align-items: center;\n min-width: 0;\n}\n\n.conversation-list-item__preview-row {\n min-width: 0;\n gap: var(--dimension-space-050);\n}\n\nds-text.conversation-list-item__title,\nds-text.conversation-list-item__preview {\n display: block;\n min-width: 0;\n}\n\nds-text.conversation-list-item__title {\n flex: 1;\n}\n\n.conversation-list-item__unread {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--dimension-size-200);\n margin-inline-end: var(--dimension-space-025);\n}\n\nds-text.conversation-list-item__preview.ds-choice-item__subtext {\n -webkit-line-clamp: 1;\n}\n\n.conversation-list-item__actions {\n position: absolute;\n top: 50%;\n right: var(--dimension-space-100);\n z-index: var(--dimension-z-index-floating);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--dimension-radius-half);\n background: var(--color-background-transparent);\n -webkit-backdrop-filter: blur(var(--effect-blur-sm));\n backdrop-filter: blur(var(--effect-blur-sm));\n opacity: 0;\n pointer-events: none;\n transform: translateY(-50%);\n}\n\n.conversation-list-item__row:hover .conversation-list-item__actions,\n.conversation-list-item__row:has(:focus-visible) .conversation-list-item__actions,\n:host(.conversation-list-item--actions-open) .conversation-list-item__actions {\n opacity: 1;\n pointer-events: auto;\n}\n\n/* Keep the row wash continuous while the pointer moves onto its sibling action. */\n.conversation-list-item__row:hover .conversation-list-item::after {\n background: var(--ds-interaction-hover);\n}\n\n:host(.conversation-list-item--actions-open) .conversation-list-item::after {\n background: var(--ds-interaction-hover);\n}\n\n.conversation-list-item__row:active .conversation-list-item::after {\n background: var(--ds-interaction-pressed);\n}\n\n@media (hover: none) {\n .conversation-list-item__actions {\n opacity: 1;\n pointer-events: auto;\n }\n\n :host(.conversation-list-item--has-actions) .conversation-list-item__title-row {\n padding-inline-end: var(--dimension-size-400);\n }\n}\n\n
|
|
275
|
+
"content": "@import '../../utils/choice-list.css';\n@import '../../utils/visually-hidden.css';\n@import '../../styles/control-elevation.css';\n\n:host {\n display: block;\n box-sizing: border-box;\n -webkit-user-select: none;\n user-select: none;\n}\n\n:host(:hover),\n:host(:focus-within),\n:host(.conversation-list-item--actions-open) {\n position: relative;\n z-index: var(--dimension-z-index-floating);\n}\n\n.conversation-list-item__row {\n position: relative;\n isolation: isolate;\n}\n\n.conversation-list-item {\n color: var(--color-foreground-primary);\n}\n\n.conversation-list-item--error {\n --ds-interaction-border-width: var(--dimension-stroke-width-012);\n --ds-interaction-border-color: var(--color-border-bold-negative);\n}\n\n.conversation-list-item__leading:empty,\n.conversation-list-item__trailing:empty {\n display: none;\n}\n\n.conversation-list-item__leading,\n.conversation-list-item__trailing,\n.conversation-list-item__preview-row {\n display: flex;\n align-items: center;\n}\n\n.conversation-list-item__leading {\n align-self: center;\n width: auto;\n height: auto;\n margin-inline-start: var(--ds-control-label-inset, var(--dimension-space-025));\n margin-inline-end: var(--dimension-space-050);\n}\n\n.conversation-list-item__content {\n min-width: 0;\n}\n\n.conversation-list-item__title-row {\n display: flex;\n align-items: center;\n min-width: 0;\n}\n\n.conversation-list-item__preview-row {\n min-width: 0;\n gap: var(--dimension-space-050);\n}\n\nds-text.conversation-list-item__title,\nds-text.conversation-list-item__preview {\n display: block;\n min-width: 0;\n}\n\nds-text.conversation-list-item__title {\n flex: 1;\n}\n\n.conversation-list-item__unread {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--dimension-size-200);\n margin-inline-end: var(--dimension-space-025);\n}\n\nds-text.conversation-list-item__preview.ds-choice-item__subtext {\n -webkit-line-clamp: 1;\n}\n\n.conversation-list-item__actions {\n position: absolute;\n top: 50%;\n right: var(--dimension-space-100);\n z-index: var(--dimension-z-index-floating);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--dimension-radius-half);\n background: var(--color-background-transparent);\n -webkit-backdrop-filter: blur(var(--effect-blur-sm));\n backdrop-filter: blur(var(--effect-blur-sm));\n opacity: 0;\n pointer-events: none;\n transform: translateY(-50%);\n}\n\n.conversation-list-item__row:hover .conversation-list-item__actions,\n.conversation-list-item__row:has(:focus-visible) .conversation-list-item__actions,\n:host(.conversation-list-item--actions-open) .conversation-list-item__actions {\n opacity: 1;\n pointer-events: auto;\n}\n\n/* Keep the row wash continuous while the pointer moves onto its sibling action. */\n.conversation-list-item__row:hover .conversation-list-item::after {\n background: var(--ds-interaction-hover);\n}\n\n:host(.conversation-list-item--actions-open) .conversation-list-item::after {\n background: var(--ds-interaction-hover);\n}\n\n.conversation-list-item__row:active .conversation-list-item::after {\n background: var(--ds-interaction-pressed);\n}\n\n@media (hover: none) {\n .conversation-list-item__actions {\n opacity: 1;\n pointer-events: auto;\n }\n\n :host(.conversation-list-item--has-actions) .conversation-list-item__title-row {\n padding-inline-end: var(--dimension-size-400);\n }\n}\n\n",
|
|
276
276
|
"type": "registry:ui"
|
|
277
277
|
},
|
|
278
278
|
{
|
|
279
279
|
"path": "src/wc/components/ConversationListItem/ConversationListItem.tsx",
|
|
280
|
-
"content": "import { Component, Element, Event, EventEmitter, h, Host, Prop } from '@stencil/core';\nimport type { ConversationItemState } from '../conversation-types';\n\n@Component({\n tag: 'ds-conversation-list-item',\n styleUrl: 'ConversationListItem.css',\n scoped: true,\n})\nexport class ConversationListItem {\n @Element() el!: HTMLElement;\n\n @Prop() conversationId: string = '';\n /** Visible conversation title. Named to avoid the native HTMLElement.title contract. */\n @Prop() conversationTitle: string = '';\n @Prop() preview: string = '';\n /** ISO timestamp for semantic activity metadata. */\n @Prop() updatedAt: string = '';\n @Prop() selected: boolean = false;\n @Prop() state: ConversationItemState = 'default';\n @Prop() statusLabel: string = '';\n @Prop() unreadCount: number = 0;\n /** Keep the contextual-actions surface visible while its popup is open or closing. */\n @Prop({ reflect: true }) actionsOpen: boolean = false;\n\n @Event() dsSelect!: EventEmitter<{ id: string }>;\n\n private handleClick = () => this.dsSelect.emit({ id: this.conversationId });\n\n private handleActionsSlotChange = (event: Event) => {\n const slot = event.target as HTMLSlotElement;\n this.el.classList.toggle(\n 'conversation-list-item--has-actions',\n slot.assignedElements().length > 0\n );\n };\n\n render() {\n const busy = this.state === 'busy';\n const subtext = busy && this.statusLabel ? this.statusLabel : this.preview;\n const accessibleName = [\n this.conversationTitle,\n subtext,\n this.unreadCount > 0 ? `${this.unreadCount} unread` : '',\n ]\n .filter(Boolean)\n .join('. ');\n\n return (\n <Host\n role=\"listitem\"\n class={{ 'conversation-list-item--actions-open': this.actionsOpen }}\n >\n <div class=\"conversation-list-item__row\">\n <button\n type=\"button\"\n class={{\n 'conversation-list-item': true,\n 'ds-choice-item': true,\n 'ds-control--md': true,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected': this.selected,\n 'conversation-list-item--error': this.state === 'error',\n }}\n aria-label={accessibleName}\n aria-current={this.selected ? 'true' : undefined}\n aria-busy={busy ? 'true' : undefined}\n onClick={this.handleClick}\n >\n <span class=\"conversation-list-item__leading ds-choice-item__icon ds-interaction-fill__content\">\n <slot name=\"leading\" />\n </span>\n <span class=\"conversation-list-item__content ds-choice-item__content ds-interaction-fill__content\">\n <span class=\"conversation-list-item__title-row\">\n <ds-text\n class=\"conversation-list-item__title ds-choice-item__label\"\n as=\"span\"\n variant=\"text-body-medium\"\n emphasis={this.unreadCount > 0}\n color={this.unreadCount > 0 ? 'primary' : 'secondary'}\n lineTruncation={1}\n >\n {this.conversationTitle}\n </ds-text>\n {this.unreadCount > 0 ? (\n <span class=\"conversation-list-item__unread\">\n <ds-badge variant=\"dot\" surface=\"secondary\" />\n </span>\n ) : null}\n </span>\n <span class=\"conversation-list-item__preview-row\">\n {busy ? <ds-loader size=\"sm\" color=\"secondary\" /> : null}\n <ds-text\n class=\"conversation-list-item__preview ds-choice-item__subtext\"\n as=\"span\"\n variant=\"text-body-small\"\n color={this.state === 'error' ? 'negative' : 'secondary'}\n lineTruncation={1}\n >\n {subtext}\n </ds-text>\n </span>\n {this.updatedAt ? (\n <time class=\"conversation-list-item__time\" dateTime={this.updatedAt}>\n {this.updatedAt}\n </time>\n ) : null}\n </span>\n <span class=\"conversation-list-item__trailing ds-interaction-fill__content\">\n <slot name=\"trailing\" />\n </span>\n </button>\n <div class=\"conversation-list-item__actions ds-control-elevation ds-control-elevation--md\">\n <slot name=\"actions\" onSlotchange={this.handleActionsSlotChange} />\n </div>\n </div>\n </Host>\n );\n }\n}\n",
|
|
280
|
+
"content": "import { Component, Element, Event, EventEmitter, h, Host, Prop } from '@stencil/core';\nimport type { ConversationItemState } from '../conversation-types';\n\n@Component({\n tag: 'ds-conversation-list-item',\n styleUrl: 'ConversationListItem.css',\n scoped: true,\n})\nexport class ConversationListItem {\n @Element() el!: HTMLElement;\n\n @Prop() conversationId: string = '';\n /** Visible conversation title. Named to avoid the native HTMLElement.title contract. */\n @Prop() conversationTitle: string = '';\n @Prop() preview: string = '';\n /** ISO timestamp for semantic activity metadata. */\n @Prop() updatedAt: string = '';\n @Prop() selected: boolean = false;\n @Prop() state: ConversationItemState = 'default';\n @Prop() statusLabel: string = '';\n @Prop() unreadCount: number = 0;\n /** Keep the contextual-actions surface visible while its popup is open or closing. */\n @Prop({ reflect: true }) actionsOpen: boolean = false;\n\n @Event() dsSelect!: EventEmitter<{ id: string }>;\n\n private handleClick = () => this.dsSelect.emit({ id: this.conversationId });\n\n private handleActionsSlotChange = (event: Event) => {\n const slot = event.target as HTMLSlotElement;\n this.el.classList.toggle(\n 'conversation-list-item--has-actions',\n slot.assignedElements().length > 0\n );\n };\n\n render() {\n const busy = this.state === 'busy';\n const subtext = busy && this.statusLabel ? this.statusLabel : this.preview;\n const accessibleName = [\n this.conversationTitle,\n subtext,\n this.unreadCount > 0 ? `${this.unreadCount} unread` : '',\n ]\n .filter(Boolean)\n .join('. ');\n\n return (\n <Host\n role=\"listitem\"\n class={{ 'conversation-list-item--actions-open': this.actionsOpen }}\n >\n <div class=\"conversation-list-item__row\">\n <button\n type=\"button\"\n class={{\n 'conversation-list-item': true,\n 'ds-choice-item': true,\n 'ds-control--md': true,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected': this.selected,\n 'conversation-list-item--error': this.state === 'error',\n }}\n aria-label={accessibleName}\n aria-current={this.selected ? 'true' : undefined}\n aria-busy={busy ? 'true' : undefined}\n onClick={this.handleClick}\n >\n <span class=\"conversation-list-item__leading ds-choice-item__icon ds-interaction-fill__content\">\n <slot name=\"leading\" />\n </span>\n <span class=\"conversation-list-item__content ds-choice-item__content ds-interaction-fill__content\">\n <span class=\"conversation-list-item__title-row\">\n <ds-text\n class=\"conversation-list-item__title ds-choice-item__label\"\n as=\"span\"\n variant=\"text-body-medium\"\n emphasis={this.unreadCount > 0}\n color={this.unreadCount > 0 ? 'primary' : 'secondary'}\n lineTruncation={1}\n >\n {this.conversationTitle}\n </ds-text>\n {this.unreadCount > 0 ? (\n <span class=\"conversation-list-item__unread\">\n <ds-badge variant=\"dot\" surface=\"secondary\" />\n </span>\n ) : null}\n </span>\n <span class=\"conversation-list-item__preview-row\">\n {busy ? <ds-loader size=\"sm\" color=\"secondary\" /> : null}\n <ds-text\n class=\"conversation-list-item__preview ds-choice-item__subtext\"\n as=\"span\"\n variant=\"text-body-small\"\n color={this.state === 'error' ? 'negative' : 'secondary'}\n lineTruncation={1}\n >\n {subtext}\n </ds-text>\n </span>\n {this.updatedAt ? (\n <time class=\"conversation-list-item__time ds-visually-hidden\" dateTime={this.updatedAt}>\n {this.updatedAt}\n </time>\n ) : null}\n </span>\n <span class=\"conversation-list-item__trailing ds-interaction-fill__content\">\n <slot name=\"trailing\" />\n </span>\n </button>\n <div class=\"conversation-list-item__actions ds-control-elevation ds-control-elevation--md\">\n <slot name=\"actions\" onSlotchange={this.handleActionsSlotChange} />\n </div>\n </div>\n </Host>\n );\n }\n}\n",
|
|
281
281
|
"type": "registry:ui"
|
|
282
282
|
}
|
|
283
283
|
]
|
|
@@ -590,7 +590,7 @@
|
|
|
590
590
|
},
|
|
591
591
|
{
|
|
592
592
|
"path": "src/wc/components/Input/Input.tsx",
|
|
593
|
-
"content": "import { AttachInternals, Component, Prop, State, Event, EventEmitter, Element, Method, Watch, h, Host } from '@stencil/core';\nimport {
|
|
593
|
+
"content": "import { AttachInternals, Component, Prop, State, Event, EventEmitter, Element, Method, Watch, h, Host } from '@stencil/core';\nimport {\n controlWidthClass,\n CONTROL_TEXT_VARIANT,\n DEFAULT_REQUIRED_MESSAGE,\n setRequiredValidity,\n type ControlWidth,\n} from '../../utils';\n\nexport type InputType = 'text' | 'email' | 'tel' | 'url' | 'search' | 'password';\nexport type InputSize = 'md' | 'sm' | 'xs';\nexport type InputWidth = ControlWidth;\n\nconst ICON_SIZE: Record<InputSize, 'md' | 'sm' | 'xs'> = {\n md: 'md',\n sm: 'sm',\n xs: 'xs',\n};\n\nconst CLEAR_BUTTON_SIZE: Record<InputSize, 'sm' | 'xs'> = {\n md: 'sm',\n sm: 'xs',\n xs: 'xs',\n};\n\nlet idCounter = 0;\n\n@Component({\n tag: 'ds-input',\n styleUrl: 'Input.css',\n scoped: true,\n formAssociated: true,\n})\nexport class Input {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n private generatedId = `ds-input-${++idCounter}`;\n private errorId = `${this.generatedId}-error`;\n\n @Prop({ mutable: true }) value: string = '';\n @Prop({ reflect: true }) name: string | undefined;\n @Prop({ reflect: true }) form: string | undefined;\n @Prop({ reflect: true }) disabled: boolean = false;\n /** Keeps the value focusable and submittable while preventing edits. */\n @Prop({ reflect: true }) readOnly: boolean = false;\n @Prop({ reflect: true }) required: boolean = false;\n @Prop() requiredMessage: string = DEFAULT_REQUIRED_MESSAGE;\n @Prop() clearLabel: string = 'Clear';\n @Prop() placeholder: string | undefined;\n @Prop() type: InputType = 'text';\n /** Native browser autofill hint. */\n @Prop({ attribute: 'autocomplete' }) autoComplete: string | undefined;\n /** Preferred virtual keyboard without changing the value semantics. */\n @Prop({ attribute: 'inputmode' }) inputMode: string = '';\n /** Preferred virtual-keyboard action label. */\n @Prop({ attribute: 'enterkeyhint' }) enterKeyHint: string = '';\n /** Control density. */\n @Prop() size: InputSize = 'md';\n /** Width fit — fill the parent (default) or hug the available content. */\n @Prop() width: InputWidth = 'fill';\n /** Show the standard inset border. */\n @Prop() hasBorder: boolean = true;\n /** Optional leading icon name. */\n @Prop() icon: string | undefined;\n @Prop() isInactive: boolean = false;\n @Prop() autoFocus: boolean = false;\n @Prop() error: boolean = false;\n @Prop() errorMessage: string | undefined;\n /** Associates the internal input with an external <label>. */\n @Prop() inputId: string | undefined;\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n @Prop({ attribute: 'aria-labelledby' }) ariaLabelledby: string | undefined;\n @Prop({ attribute: 'aria-describedby' }) ariaDescribedby: string | undefined;\n\n @Event() dsChange!: EventEmitter<string>;\n @Event() dsClear!: EventEmitter<void>;\n\n private initialValue = '';\n @State() private formDisabled = false;\n @State() private hasSuffix = false;\n @State() private focused = false;\n @State() private touched = false;\n\n componentWillLoad() {\n this.initialValue = this.value;\n this.hasSuffix = Boolean(this.el.querySelector('[slot=\"suffix\"]'));\n this.syncFormValue();\n }\n\n componentDidRender() {\n const hasSuffix = Boolean(this.el.querySelector('[slot=\"suffix\"]'));\n if (hasSuffix !== this.hasSuffix) this.hasSuffix = hasSuffix;\n }\n\n @Watch('value')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('required')\n syncFormValue() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n this.internals.setFormValue(inactive ? null : this.value);\n const missing = this.required && !inactive && this.value.length === 0;\n setRequiredValidity(this.internals, missing, this.requiredMessage);\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.value = this.initialValue;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.value = typeof state === 'string' ? state : '';\n }\n\n @Method()\n async setFocus() {\n this.el.querySelector('input')?.focus();\n }\n\n private handleInput = (e: Event) => {\n this.value = (e.target as HTMLInputElement).value;\n this.dsChange.emit(this.value);\n };\n\n private handleFocus = () => {\n this.focused = true;\n };\n\n private handleBlur = () => {\n this.focused = false;\n this.touched = true;\n };\n\n private handleClear = () => {\n this.value = '';\n this.dsChange.emit('');\n this.dsClear.emit();\n this.el.querySelector('input')?.focus();\n };\n\n render() {\n const inputId = this.inputId ?? this.generatedId;\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n const filled = this.value.length > 0;\n const dirty = this.value !== this.initialValue;\n const showClear = this.type === 'search' && filled && !inactive && !this.readOnly;\n const showError = this.error && Boolean(this.errorMessage);\n const textVariant = CONTROL_TEXT_VARIANT[this.size];\n const iconSize = ICON_SIZE[this.size];\n\n const describedBy = [\n this.ariaDescribedby,\n showError ? this.errorId : undefined,\n ].filter(Boolean).join(' ') || undefined;\n\n return (\n <Host\n class={{\n 'input-host': true,\n 'ds-control-inactive': inactive,\n [`ds-control--${this.size}`]: true,\n ...controlWidthClass(this.width),\n }}\n data-disabled={inactive ? '' : undefined}\n data-readonly={this.readOnly ? '' : undefined}\n data-required={this.required ? '' : undefined}\n data-invalid={this.error ? '' : undefined}\n data-filled={filled ? '' : undefined}\n data-focused={this.focused ? '' : undefined}\n data-dirty={dirty ? '' : undefined}\n data-touched={this.touched ? '' : undefined}\n >\n <div\n class={{\n 'input-control': true,\n 'input-control--bordered': this.hasBorder || this.error,\n 'input-control--error': this.error,\n 'ds-interaction-fill': true,\n [`ds-control--${this.size}`]: true,\n }}\n >\n {this.icon && (\n <span class=\"input-control__prefix ds-interaction-fill__content\" aria-hidden=\"true\">\n <ds-icon name={this.icon} size={iconSize} color=\"inherit\" />\n </span>\n )}\n <input\n type={this.type}\n id={inputId}\n value={this.value}\n placeholder={this.placeholder}\n disabled={inactive}\n readOnly={this.readOnly}\n required={this.required}\n autoFocus={this.autoFocus}\n autoComplete={this.autoComplete}\n inputMode={this.inputMode || undefined}\n enterKeyHint={this.enterKeyHint || undefined}\n class={`native-input ds-text--${textVariant.replace('text-', '')} ds-text--regular ds-interaction-fill__content`}\n aria-label={this.ariaLabel}\n aria-labelledby={this.ariaLabelledby}\n aria-describedby={describedBy}\n aria-invalid={this.error ? 'true' : undefined}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n <span class={{ 'input-control__suffix': true, 'input-control__suffix--empty': !this.hasSuffix }}>\n <slot name=\"suffix\" />\n </span>\n {showClear && (\n <ds-button-unfilled\n class=\"input-control__clear\"\n variant=\"icon\"\n size={CLEAR_BUTTON_SIZE[this.size]}\n icon=\"CrossCircle\"\n hasBorder={false}\n rounded\n ariaLabel={this.clearLabel}\n onDsClick={this.handleClear}\n />\n )}\n </div>\n {showError && (\n <ds-text\n class=\"error-text\"\n as=\"div\"\n variant=\"text-body-small\"\n color=\"negative\"\n textId={this.errorId}\n role=\"alert\"\n >\n {this.errorMessage}\n </ds-text>\n )}\n </Host>\n );\n }\n}\n",
|
|
594
594
|
"type": "registry:ui"
|
|
595
595
|
}
|
|
596
596
|
]
|
|
@@ -180,12 +180,12 @@
|
|
|
180
180
|
"files": [
|
|
181
181
|
{
|
|
182
182
|
"path": "src/wc/components/Loader/Loader.css",
|
|
183
|
-
"content": "/* ── Base loader (mirrors ds-icon box metrics) ───────────────────────────── */\n\n.loader {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n line-height: 0;\n color: inherit;\n width: var(--_loader-sz, var(--dimension-iconography-md));\n height: var(--_loader-sz, var(--dimension-iconography-md));\n animation: loader-spin var(--effect-animation-duration-long-2) var(--effect-animation-easing-linear) infinite;\n}\n\n.loader__svg {\n display: block;\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n}\n\n.status {\n display: inline-flex;\n align-items: center;\n}\n\n
|
|
183
|
+
"content": "@import '../../utils/visually-hidden.css';\n\n/* ── Base loader (mirrors ds-icon box metrics) ───────────────────────────── */\n\n.loader {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n line-height: 0;\n color: inherit;\n width: var(--_loader-sz, var(--dimension-iconography-md));\n height: var(--_loader-sz, var(--dimension-iconography-md));\n animation: loader-spin var(--effect-animation-duration-long-2) var(--effect-animation-easing-linear) infinite;\n}\n\n.loader__svg {\n display: block;\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n}\n\n.status {\n display: inline-flex;\n align-items: center;\n}\n\n/* Anti-clockwise continuous spin — 1000ms via long-2. */\n@keyframes loader-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(-360deg); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .loader {\n animation: none;\n transform: none;\n }\n}\n\n/* ── Sizes (same tokens as ds-icon) ──────────────────────────────────────── */\n\n.loader--size-xs { --_loader-sz: var(--dimension-iconography-xs); }\n.loader--size-sm { --_loader-sz: var(--dimension-iconography-sm); }\n.loader--size-md { --_loader-sz: var(--dimension-iconography-md); }\n.loader--size-lg { --_loader-sz: var(--dimension-iconography-lg); }\n.loader--size-xl { --_loader-sz: var(--dimension-iconography-xl); }\n.loader--size-2xl { --_loader-sz: var(--dimension-iconography-2xl); }\n.loader--size-3xl { --_loader-sz: var(--dimension-iconography-3xl); }\n\n/* ── Colors — hierarchy ──────────────────────────────────────────────────── */\n\n.loader--color-primary { color: var(--color-foreground-primary); }\n.loader--color-secondary { color: var(--color-foreground-secondary); }\n.loader--color-tertiary { color: var(--color-foreground-tertiary); }\n.loader--color-quaternary { color: var(--color-foreground-quaternary); }\n.loader--color-inherit { color: inherit; }\n\n/* ── Colors — intent (bold contrast default) ─────────────────────────────── */\n\n.loader--color-brand { color: var(--color-foreground-bold-brand); }\n.loader--color-negative { color: var(--color-foreground-bold-negative); }\n.loader--color-positive { color: var(--color-foreground-bold-positive); }\n.loader--color-warning { color: var(--color-foreground-bold-warning); }\n.loader--color-caution { color: var(--color-foreground-bold-caution); }\n.loader--color-ai { color: var(--color-foreground-bold-ai); }\n.loader--color-guide { color: var(--color-foreground-bold-guide); }\n.loader--color-neutral { color: var(--color-foreground-bold-neutral); }\n\n/* ── Colors — intent faint ───────────────────────────────────────────────── */\n\n.loader--color-faint-brand { color: var(--color-foreground-faint-brand); }\n.loader--color-faint-negative { color: var(--color-foreground-faint-negative); }\n.loader--color-faint-positive { color: var(--color-foreground-faint-positive); }\n.loader--color-faint-warning { color: var(--color-foreground-faint-warning); }\n.loader--color-faint-caution { color: var(--color-foreground-faint-caution); }\n.loader--color-faint-ai { color: var(--color-foreground-faint-ai); }\n.loader--color-faint-neutral { color: var(--color-foreground-faint-neutral); }\n\n/* ── Colors — intent medium ─────────────────────────────────────────────── */\n\n.loader--color-medium-brand { color: var(--color-foreground-medium-brand); }\n.loader--color-medium-negative { color: var(--color-foreground-medium-negative); }\n.loader--color-medium-positive { color: var(--color-foreground-medium-positive); }\n.loader--color-medium-warning { color: var(--color-foreground-medium-warning); }\n.loader--color-medium-caution { color: var(--color-foreground-medium-caution); }\n.loader--color-medium-ai { color: var(--color-foreground-medium-ai); }\n.loader--color-medium-neutral { color: var(--color-foreground-medium-neutral); }\n\n/* ── Colors — intent bold (explicit) ────────────────────────────────────── */\n\n.loader--color-bold-brand { color: var(--color-foreground-bold-brand); }\n.loader--color-bold-negative { color: var(--color-foreground-bold-negative); }\n.loader--color-bold-positive { color: var(--color-foreground-bold-positive); }\n.loader--color-bold-warning { color: var(--color-foreground-bold-warning); }\n.loader--color-bold-caution { color: var(--color-foreground-bold-caution); }\n.loader--color-bold-ai { color: var(--color-foreground-bold-ai); }\n.loader--color-bold-neutral { color: var(--color-foreground-bold-neutral); }\n\n/* ── Colors — intent strong ──────────────────────────────────────────────── */\n\n.loader--color-strong-brand { color: var(--color-foreground-strong-brand); }\n.loader--color-strong-negative { color: var(--color-foreground-strong-negative); }\n.loader--color-strong-positive { color: var(--color-foreground-strong-positive); }\n.loader--color-strong-warning { color: var(--color-foreground-strong-warning); }\n.loader--color-strong-caution { color: var(--color-foreground-strong-caution); }\n.loader--color-strong-ai { color: var(--color-foreground-strong-ai); }\n.loader--color-strong-neutral { color: var(--color-foreground-strong-neutral); }\n\n/* ── Colors — contextual ────────────────────────────────────────────────── */\n\n.loader--color-on-strong { color: var(--color-foreground-on-strong-background-primary); }\n.loader--color-on-bold { color: var(--color-foreground-on-bold-background-primary); }\n",
|
|
184
184
|
"type": "registry:ui"
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
"path": "src/wc/components/Loader/Loader.tsx",
|
|
188
|
-
"content": "import { Component, Prop, h, Host } from '@stencil/core';\nimport type { IconColor, IconSize } from '../Icon/Icon';\n\nexport type LoaderSize = IconSize;\nexport type LoaderColor = IconColor;\n\n@Component({\n tag: 'ds-loader',\n styleUrl: 'Loader.css',\n shadow: true,\n})\nexport class Loader {\n /** Iconography size token. Maps to `--dimension-iconography-{size}`. Default `md` = 20 px. */\n @Prop() size: LoaderSize = 'md';\n /**\n * Semantic foreground color token, or a raw CSS var reference. Same tokens\n * as `ds-icon`. Do not use `tertiary` or `quaternary` for a standalone or\n * informative Loader; inherit a readable color from the owning busy control\n * or region.\n */\n @Prop() color: LoaderColor = 'inherit';\n /**\n * Accessible label for standalone usage. Wraps the spinner in a live region\n * and renders the label visually-hidden. Omit when the host element already\n * conveys busy state via aria-busy.\n */\n @Prop() label: string | undefined;\n\n render() {\n const isCustomColor = typeof this.color === 'string' && this.color.startsWith('var(--');\n\n const cls: Record<string, boolean> = {\n loader: true,\n [`loader--size-${this.size}`]: true,\n [`loader--color-${this.color}`]: !!this.color && !isCustomColor && this.color !== 'inherit',\n 'loader--color-inherit': this.color === 'inherit',\n };\n\n const style = isCustomColor ? { color: this.color as string } : undefined;\n\n const spinner = (\n <span class={cls} style={style} aria-hidden=\"true\">\n <svg class=\"loader__svg\" viewBox=\"0 0 16 16\" fill=\"none\" focusable=\"false\">\n <path\n opacity=\"0.1\"\n d=\"M3 8C3 5.23858 5.23858 3 8 3V2C4.68629 2 2 4.68629 2 8C2 9.99456 2.97323 11.7618 4.47072 12.8528L5.05894 12.044C3.81102 11.1348 3 9.66213 3 8Z\"\n fill=\"currentColor\"\n />\n <path\n opacity=\"0.2\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M5.05892 12.0438C5.88425 12.6451 6.90069 12.9998 7.99998 12.9998C9.66211 12.9998 11.1348 12.1888 12.0439 10.9409L12.8527 11.5291C11.7618 13.0266 9.99454 13.9998 7.99998 13.9998C6.68083 13.9998 5.46111 13.5741 4.4707 12.8526L5.05892 12.0438Z\"\n fill=\"currentColor\"\n />\n <path\n opacity=\"0.4\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12.0435 10.9408C12.6447 10.1155 12.9995 9.09906 12.9995 7.99976C12.9995 7.45884 12.9136 6.93798 12.7547 6.45007L13.7057 6.14014C13.8964 6.72562 13.9995 7.35065 13.9995 7.99976C13.9995 9.31891 13.5738 10.5386 12.8523 11.529L12.0435 10.9408Z\"\n fill=\"currentColor\"\n />\n <path\n opacity=\"0.6\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12.7555 6.45152C12.4263 5.43958 11.7831 4.56933 10.9409 3.95577L11.5291 3.14697C12.5398 3.88325 13.3116 4.92755 13.7067 6.14188L12.7555 6.45152Z\"\n fill=\"currentColor\"\n />\n <path\n opacity=\"0.8\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10.941 3.95583C10.5307 3.65688 10.0731 3.41886 9.58154 3.25509L9.89786 2.30615C10.4877 2.50267 11.0368 2.78829 11.5293 3.14704L10.941 3.95583Z\"\n fill=\"currentColor\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M9.89788 2.30636C9.3014 2.10762 8.66327 2 8 2V3C8.55272 3 9.0845 3.08968 9.58157 3.2553L9.89788 2.30636Z\"\n fill=\"currentColor\"\n />\n </svg>\n </span>\n );\n\n if (!this.label) {\n return (\n <Host style={{ display: 'inline-flex', alignItems: 'center', justifyContent: 'center' }}>\n {spinner}\n </Host>\n );\n }\n\n return (\n <Host style={{ display: 'inline-flex', alignItems: 'center', justifyContent: 'center' }}>\n <span role=\"status\" aria-live=\"polite\" class=\"status\">\n {spinner}\n <span class=\"visually-hidden\">{this.label}</span>\n </span>\n </Host>\n );\n }\n}\n",
|
|
188
|
+
"content": "import { Component, Prop, h, Host } from '@stencil/core';\nimport type { IconColor, IconSize } from '../Icon/Icon';\n\nexport type LoaderSize = IconSize;\nexport type LoaderColor = IconColor;\n\n@Component({\n tag: 'ds-loader',\n styleUrl: 'Loader.css',\n shadow: true,\n})\nexport class Loader {\n /** Iconography size token. Maps to `--dimension-iconography-{size}`. Default `md` = 20 px. */\n @Prop() size: LoaderSize = 'md';\n /**\n * Semantic foreground color token, or a raw CSS var reference. Same tokens\n * as `ds-icon`. Do not use `tertiary` or `quaternary` for a standalone or\n * informative Loader; inherit a readable color from the owning busy control\n * or region.\n */\n @Prop() color: LoaderColor = 'inherit';\n /**\n * Accessible label for standalone usage. Wraps the spinner in a live region\n * and renders the label visually-hidden. Omit when the host element already\n * conveys busy state via aria-busy.\n */\n @Prop() label: string | undefined;\n\n render() {\n const isCustomColor = typeof this.color === 'string' && this.color.startsWith('var(--');\n\n const cls: Record<string, boolean> = {\n loader: true,\n [`loader--size-${this.size}`]: true,\n [`loader--color-${this.color}`]: !!this.color && !isCustomColor && this.color !== 'inherit',\n 'loader--color-inherit': this.color === 'inherit',\n };\n\n const style = isCustomColor ? { color: this.color as string } : undefined;\n\n const spinner = (\n <span class={cls} style={style} aria-hidden=\"true\">\n <svg class=\"loader__svg\" viewBox=\"0 0 16 16\" fill=\"none\" focusable=\"false\">\n <path\n opacity=\"0.1\"\n d=\"M3 8C3 5.23858 5.23858 3 8 3V2C4.68629 2 2 4.68629 2 8C2 9.99456 2.97323 11.7618 4.47072 12.8528L5.05894 12.044C3.81102 11.1348 3 9.66213 3 8Z\"\n fill=\"currentColor\"\n />\n <path\n opacity=\"0.2\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M5.05892 12.0438C5.88425 12.6451 6.90069 12.9998 7.99998 12.9998C9.66211 12.9998 11.1348 12.1888 12.0439 10.9409L12.8527 11.5291C11.7618 13.0266 9.99454 13.9998 7.99998 13.9998C6.68083 13.9998 5.46111 13.5741 4.4707 12.8526L5.05892 12.0438Z\"\n fill=\"currentColor\"\n />\n <path\n opacity=\"0.4\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12.0435 10.9408C12.6447 10.1155 12.9995 9.09906 12.9995 7.99976C12.9995 7.45884 12.9136 6.93798 12.7547 6.45007L13.7057 6.14014C13.8964 6.72562 13.9995 7.35065 13.9995 7.99976C13.9995 9.31891 13.5738 10.5386 12.8523 11.529L12.0435 10.9408Z\"\n fill=\"currentColor\"\n />\n <path\n opacity=\"0.6\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12.7555 6.45152C12.4263 5.43958 11.7831 4.56933 10.9409 3.95577L11.5291 3.14697C12.5398 3.88325 13.3116 4.92755 13.7067 6.14188L12.7555 6.45152Z\"\n fill=\"currentColor\"\n />\n <path\n opacity=\"0.8\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10.941 3.95583C10.5307 3.65688 10.0731 3.41886 9.58154 3.25509L9.89786 2.30615C10.4877 2.50267 11.0368 2.78829 11.5293 3.14704L10.941 3.95583Z\"\n fill=\"currentColor\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M9.89788 2.30636C9.3014 2.10762 8.66327 2 8 2V3C8.55272 3 9.0845 3.08968 9.58157 3.2553L9.89788 2.30636Z\"\n fill=\"currentColor\"\n />\n </svg>\n </span>\n );\n\n if (!this.label) {\n return (\n <Host style={{ display: 'inline-flex', alignItems: 'center', justifyContent: 'center' }}>\n {spinner}\n </Host>\n );\n }\n\n return (\n <Host style={{ display: 'inline-flex', alignItems: 'center', justifyContent: 'center' }}>\n <span role=\"status\" aria-live=\"polite\" class=\"status\">\n {spinner}\n <span class=\"visually-hidden ds-visually-hidden\">{this.label}</span>\n </span>\n </Host>\n );\n }\n}\n",
|
|
189
189
|
"type": "registry:ui"
|
|
190
190
|
}
|
|
191
191
|
]
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "mobile-bar-nav",
|
|
4
|
+
"title": "MobileBarNav",
|
|
5
|
+
"description": "Persistent mobile shell navigation for Menu, the router-derived current area, Search, Agents, and Inbox.",
|
|
6
|
+
"type": "registry:ui",
|
|
7
|
+
"meta": {
|
|
8
|
+
"library": "@ds-mo/ui",
|
|
9
|
+
"distribution": "npm",
|
|
10
|
+
"storybook": "https://zainadeel.github.io/compomo/?path=/story/mobile-bar-nav",
|
|
11
|
+
"source": "src/wc/components/MobileBarNav/MobileBarNav.tsx",
|
|
12
|
+
"intentStatus": "complete",
|
|
13
|
+
"intent": {
|
|
14
|
+
"audience": "specialized",
|
|
15
|
+
"status": "experimental",
|
|
16
|
+
"summary": "Persistent mobile shell navigation for Menu, the router-derived current area, Search, Agents, and Inbox.",
|
|
17
|
+
"useWhen": [
|
|
18
|
+
"ShellApp is rendering its dedicated below-768px application composition."
|
|
19
|
+
],
|
|
20
|
+
"avoidWhen": [
|
|
21
|
+
"Rendering desktop or tablet shell chrome.",
|
|
22
|
+
"An arbitrary set of product tabs is required."
|
|
23
|
+
],
|
|
24
|
+
"commonlyComposedWith": [
|
|
25
|
+
"component:ds-shell-app"
|
|
26
|
+
],
|
|
27
|
+
"patterns": [
|
|
28
|
+
"pattern:application-shell"
|
|
29
|
+
],
|
|
30
|
+
"accessibility": [
|
|
31
|
+
"Every icon-only item keeps a localized accessible name.",
|
|
32
|
+
"Only the active destination exposes aria-current; Menu exposes its controlled pane through aria-expanded."
|
|
33
|
+
],
|
|
34
|
+
"states": [
|
|
35
|
+
"The fixed groups are Menu plus current area, followed by Search, Inbox, and Agents.",
|
|
36
|
+
"Selection promotes foreground to primary without painting a selected fill; unselected destinations use tertiary foreground.",
|
|
37
|
+
"Opening Mobile Sheet Nav replaces the Menu glyph with Cross while preserving its accessible name.",
|
|
38
|
+
"Reselecting an active destination does not reset its nested state."
|
|
39
|
+
],
|
|
40
|
+
"responsiveBehavior": [
|
|
41
|
+
"Render only below the mobile breakpoint and preserve safe-area clearance.",
|
|
42
|
+
"The two icon-only control groups remain centered with fixed 40px targets and a divider between Menu and current area."
|
|
43
|
+
],
|
|
44
|
+
"references": [
|
|
45
|
+
{
|
|
46
|
+
"label": "Storybook",
|
|
47
|
+
"path": "src/wc/components/MobileBarNav/MobileBarNav.stories.ts"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"api": {
|
|
52
|
+
"props": {
|
|
53
|
+
"activeDestination": {
|
|
54
|
+
"type": "MobileDestination",
|
|
55
|
+
"resolvedType": "\"agents\" | \"area\" | \"help\" | \"inbox\" | \"search\"",
|
|
56
|
+
"attribute": "active-destination",
|
|
57
|
+
"default": "'area'",
|
|
58
|
+
"required": false,
|
|
59
|
+
"mutable": false
|
|
60
|
+
},
|
|
61
|
+
"agentsDot": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"resolvedType": "boolean",
|
|
64
|
+
"attribute": "agents-dot",
|
|
65
|
+
"default": "false",
|
|
66
|
+
"required": false,
|
|
67
|
+
"mutable": false
|
|
68
|
+
},
|
|
69
|
+
"agentsLabel": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"resolvedType": "string",
|
|
72
|
+
"attribute": "agents-label",
|
|
73
|
+
"default": "'Agents'",
|
|
74
|
+
"required": false,
|
|
75
|
+
"mutable": false
|
|
76
|
+
},
|
|
77
|
+
"currentArea": {
|
|
78
|
+
"type": "PanelNavItem",
|
|
79
|
+
"resolvedType": "PanelNavItem",
|
|
80
|
+
"default": "{\n id: 'tracking',\n icon: 'MapPage',\n label: 'Tracking',\n }",
|
|
81
|
+
"required": false,
|
|
82
|
+
"mutable": false
|
|
83
|
+
},
|
|
84
|
+
"helpLabel": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"resolvedType": "string",
|
|
87
|
+
"attribute": "help-label",
|
|
88
|
+
"default": "'Help & Support'",
|
|
89
|
+
"required": false,
|
|
90
|
+
"mutable": false
|
|
91
|
+
},
|
|
92
|
+
"inboxDot": {
|
|
93
|
+
"type": "boolean",
|
|
94
|
+
"resolvedType": "boolean",
|
|
95
|
+
"attribute": "inbox-dot",
|
|
96
|
+
"default": "false",
|
|
97
|
+
"required": false,
|
|
98
|
+
"mutable": false
|
|
99
|
+
},
|
|
100
|
+
"inboxLabel": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"resolvedType": "string",
|
|
103
|
+
"attribute": "inbox-label",
|
|
104
|
+
"default": "'Inbox'",
|
|
105
|
+
"required": false,
|
|
106
|
+
"mutable": false
|
|
107
|
+
},
|
|
108
|
+
"menuLabel": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"resolvedType": "string",
|
|
111
|
+
"attribute": "menu-label",
|
|
112
|
+
"default": "'Menu'",
|
|
113
|
+
"required": false,
|
|
114
|
+
"mutable": false
|
|
115
|
+
},
|
|
116
|
+
"searchDot": {
|
|
117
|
+
"type": "boolean",
|
|
118
|
+
"resolvedType": "boolean",
|
|
119
|
+
"attribute": "search-dot",
|
|
120
|
+
"default": "false",
|
|
121
|
+
"required": false,
|
|
122
|
+
"mutable": false
|
|
123
|
+
},
|
|
124
|
+
"searchLabel": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"resolvedType": "string",
|
|
127
|
+
"attribute": "search-label",
|
|
128
|
+
"default": "'Search'",
|
|
129
|
+
"required": false,
|
|
130
|
+
"mutable": false
|
|
131
|
+
},
|
|
132
|
+
"sheetNavExpanded": {
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"resolvedType": "boolean",
|
|
135
|
+
"attribute": "sheet-nav-expanded",
|
|
136
|
+
"default": "false",
|
|
137
|
+
"required": false,
|
|
138
|
+
"mutable": false
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"events": [
|
|
142
|
+
{
|
|
143
|
+
"name": "dsDestinationChange",
|
|
144
|
+
"detail": "MobileBarNavDestinationDetail",
|
|
145
|
+
"bubbles": true,
|
|
146
|
+
"cancelable": true,
|
|
147
|
+
"composed": true
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "dsSheetNavToggle",
|
|
151
|
+
"detail": "boolean",
|
|
152
|
+
"bubbles": true,
|
|
153
|
+
"cancelable": true,
|
|
154
|
+
"composed": true
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"methods": [
|
|
158
|
+
{
|
|
159
|
+
"name": "focusDestination",
|
|
160
|
+
"signature": "focusDestination(destination: MobileDestination | \"sheet-nav\") => Promise<void>"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"slots": []
|
|
164
|
+
},
|
|
165
|
+
"props": {
|
|
166
|
+
"activeDestination": {
|
|
167
|
+
"type": "MobileDestination",
|
|
168
|
+
"resolvedType": "\"agents\" | \"area\" | \"help\" | \"inbox\" | \"search\"",
|
|
169
|
+
"attribute": "active-destination",
|
|
170
|
+
"default": "'area'",
|
|
171
|
+
"required": false,
|
|
172
|
+
"mutable": false
|
|
173
|
+
},
|
|
174
|
+
"agentsDot": {
|
|
175
|
+
"type": "boolean",
|
|
176
|
+
"resolvedType": "boolean",
|
|
177
|
+
"attribute": "agents-dot",
|
|
178
|
+
"default": "false",
|
|
179
|
+
"required": false,
|
|
180
|
+
"mutable": false
|
|
181
|
+
},
|
|
182
|
+
"agentsLabel": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"resolvedType": "string",
|
|
185
|
+
"attribute": "agents-label",
|
|
186
|
+
"default": "'Agents'",
|
|
187
|
+
"required": false,
|
|
188
|
+
"mutable": false
|
|
189
|
+
},
|
|
190
|
+
"currentArea": {
|
|
191
|
+
"type": "PanelNavItem",
|
|
192
|
+
"resolvedType": "PanelNavItem",
|
|
193
|
+
"default": "{\n id: 'tracking',\n icon: 'MapPage',\n label: 'Tracking',\n }",
|
|
194
|
+
"required": false,
|
|
195
|
+
"mutable": false
|
|
196
|
+
},
|
|
197
|
+
"helpLabel": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"resolvedType": "string",
|
|
200
|
+
"attribute": "help-label",
|
|
201
|
+
"default": "'Help & Support'",
|
|
202
|
+
"required": false,
|
|
203
|
+
"mutable": false
|
|
204
|
+
},
|
|
205
|
+
"inboxDot": {
|
|
206
|
+
"type": "boolean",
|
|
207
|
+
"resolvedType": "boolean",
|
|
208
|
+
"attribute": "inbox-dot",
|
|
209
|
+
"default": "false",
|
|
210
|
+
"required": false,
|
|
211
|
+
"mutable": false
|
|
212
|
+
},
|
|
213
|
+
"inboxLabel": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"resolvedType": "string",
|
|
216
|
+
"attribute": "inbox-label",
|
|
217
|
+
"default": "'Inbox'",
|
|
218
|
+
"required": false,
|
|
219
|
+
"mutable": false
|
|
220
|
+
},
|
|
221
|
+
"menuLabel": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"resolvedType": "string",
|
|
224
|
+
"attribute": "menu-label",
|
|
225
|
+
"default": "'Menu'",
|
|
226
|
+
"required": false,
|
|
227
|
+
"mutable": false
|
|
228
|
+
},
|
|
229
|
+
"searchDot": {
|
|
230
|
+
"type": "boolean",
|
|
231
|
+
"resolvedType": "boolean",
|
|
232
|
+
"attribute": "search-dot",
|
|
233
|
+
"default": "false",
|
|
234
|
+
"required": false,
|
|
235
|
+
"mutable": false
|
|
236
|
+
},
|
|
237
|
+
"searchLabel": {
|
|
238
|
+
"type": "string",
|
|
239
|
+
"resolvedType": "string",
|
|
240
|
+
"attribute": "search-label",
|
|
241
|
+
"default": "'Search'",
|
|
242
|
+
"required": false,
|
|
243
|
+
"mutable": false
|
|
244
|
+
},
|
|
245
|
+
"sheetNavExpanded": {
|
|
246
|
+
"type": "boolean",
|
|
247
|
+
"resolvedType": "boolean",
|
|
248
|
+
"attribute": "sheet-nav-expanded",
|
|
249
|
+
"default": "false",
|
|
250
|
+
"required": false,
|
|
251
|
+
"mutable": false
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"events": [
|
|
255
|
+
{
|
|
256
|
+
"name": "dsDestinationChange",
|
|
257
|
+
"detail": "MobileBarNavDestinationDetail",
|
|
258
|
+
"bubbles": true,
|
|
259
|
+
"cancelable": true,
|
|
260
|
+
"composed": true
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "dsSheetNavToggle",
|
|
264
|
+
"detail": "boolean",
|
|
265
|
+
"bubbles": true,
|
|
266
|
+
"cancelable": true,
|
|
267
|
+
"composed": true
|
|
268
|
+
}
|
|
269
|
+
],
|
|
270
|
+
"methods": [
|
|
271
|
+
{
|
|
272
|
+
"name": "focusDestination",
|
|
273
|
+
"signature": "focusDestination(destination: MobileDestination | \"sheet-nav\") => Promise<void>"
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
"slots": [],
|
|
277
|
+
"exports": {
|
|
278
|
+
"customElement": "ds-mobile-bar-nav",
|
|
279
|
+
"react": "DsMobileBarNav",
|
|
280
|
+
"angular": "DsMobileBarNav"
|
|
281
|
+
},
|
|
282
|
+
"consumption": {
|
|
283
|
+
"install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
|
|
284
|
+
"cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
|
|
285
|
+
"customElements": {
|
|
286
|
+
"import": "import '@ds-mo/ui/dist/components/ds-mobile-bar-nav.js';",
|
|
287
|
+
"example": "<ds-mobile-bar-nav></ds-mobile-bar-nav>"
|
|
288
|
+
},
|
|
289
|
+
"react": {
|
|
290
|
+
"import": "import { DsMobileBarNav } from '@ds-mo/ui/react';",
|
|
291
|
+
"example": "<DsMobileBarNav />"
|
|
292
|
+
},
|
|
293
|
+
"angular": {
|
|
294
|
+
"import": "import { DsMobileBarNav } from '@ds-mo/ui/angular/ds-mobile-bar-nav';",
|
|
295
|
+
"example": "<ds-mobile-bar-nav></ds-mobile-bar-nav>"
|
|
296
|
+
},
|
|
297
|
+
"complexPropertyNote": "Assign these non-primitive values as JavaScript properties: currentArea.",
|
|
298
|
+
"peerDependencies": {
|
|
299
|
+
"required": [
|
|
300
|
+
"@ds-mo/tokens ^3.1.1",
|
|
301
|
+
"@ds-mo/icons ^6.4.0"
|
|
302
|
+
],
|
|
303
|
+
"frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"dependencies": [
|
|
308
|
+
"@ds-mo/ui",
|
|
309
|
+
"@ds-mo/tokens",
|
|
310
|
+
"@ds-mo/icons"
|
|
311
|
+
],
|
|
312
|
+
"registryDependencies": [
|
|
313
|
+
"badge",
|
|
314
|
+
"icon"
|
|
315
|
+
],
|
|
316
|
+
"files": [
|
|
317
|
+
{
|
|
318
|
+
"path": "src/wc/components/MobileBarNav/MobileBarNav.css",
|
|
319
|
+
"content": "@import '../../utils/focus-ring.css';\n@import '../../utils/interaction-fill.css';\n\n:host {\n display: block;\n min-width: 0;\n background: var(--color-background-primary);\n color: var(--color-foreground-tertiary);\n}\n\n.mobile-bar-nav {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--dimension-space-200);\n min-width: 0;\n padding: var(--dimension-space-200) var(--dimension-space-200)\n max(var(--dimension-space-200), env(safe-area-inset-bottom));\n border-top: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n background: var(--color-background-primary);\n box-sizing: border-box;\n}\n\n.mobile-bar-nav__group {\n display: flex;\n align-items: center;\n gap: var(--dimension-space-100);\n}\n\n.mobile-bar-nav__item {\n appearance: none;\n flex: 0 0 var(--dimension-size-500);\n width: var(--dimension-size-500);\n height: var(--dimension-size-500);\n padding: var(--dimension-space-100);\n border: 0;\n border-radius: var(--dimension-radius-025);\n background: transparent;\n color: inherit;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n\n.mobile-bar-nav__item--selected {\n color: var(--color-foreground-primary);\n}\n\n.mobile-bar-nav__divider {\n flex: 0 0 var(--dimension-stroke-width-012);\n width: var(--dimension-stroke-width-012);\n height: var(--dimension-iconography-lg);\n background: var(--color-border-tertiary);\n}\n\n.mobile-bar-nav__icon {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--dimension-iconography-lg);\n height: var(--dimension-iconography-lg);\n}\n\n.mobile-bar-nav__dot {\n position: absolute;\n inset-block-start: calc(var(--dimension-space-025) * -1);\n inset-inline-end: calc(var(--dimension-space-025) * -1);\n}\n",
|
|
320
|
+
"type": "registry:ui"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"path": "src/wc/components/MobileBarNav/MobileBarNav.tsx",
|
|
324
|
+
"content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n} from '@stencil/core';\nimport {\n shouldEmitMobileDestinationChange,\n type MobileDestination,\n} from '../../shell/shell-responsive';\nimport type { PanelNavItem } from '../PanelNav/panel-nav-types';\nimport type { MobileBarNavDestinationDetail } from './mobile-bar-nav-types';\n\ninterface DestinationConfig {\n id: MobileDestination;\n icon: string;\n label: string;\n dot: boolean;\n}\n\n@Component({\n tag: 'ds-mobile-bar-nav',\n styleUrl: 'MobileBarNav.css',\n scoped: true,\n})\nexport class MobileBarNav {\n @Element() el!: HTMLElement;\n\n @Prop() activeDestination: MobileDestination = 'area';\n @Prop() currentArea: PanelNavItem = {\n id: 'tracking',\n icon: 'MapPage',\n label: 'Tracking',\n };\n @Prop() sheetNavExpanded: boolean = false;\n @Prop() menuLabel: string = 'Menu';\n @Prop() searchLabel: string = 'Search';\n @Prop() agentsLabel: string = 'Agents';\n @Prop() inboxLabel: string = 'Inbox';\n @Prop() helpLabel: string = 'Help & Support';\n @Prop() searchDot: boolean = false;\n @Prop() agentsDot: boolean = false;\n @Prop() inboxDot: boolean = false;\n\n @Event() dsSheetNavToggle!: EventEmitter<boolean>;\n @Event() dsDestinationChange!: EventEmitter<MobileBarNavDestinationDetail>;\n\n private destinationConfig(): DestinationConfig[] {\n const currentArea =\n this.activeDestination === 'help'\n ? {\n id: 'help' as const,\n icon: 'CircleQuestion',\n label: this.helpLabel,\n dot: false,\n }\n : {\n id: 'area' as const,\n icon: this.currentArea.icon || 'MapPage',\n label: this.currentArea.label || 'Area',\n dot: false,\n };\n\n return [\n currentArea,\n { id: 'search', icon: 'MagnifyingGlass', label: this.searchLabel, dot: this.searchDot },\n { id: 'inbox', icon: 'Inbox', label: this.inboxLabel, dot: this.inboxDot },\n { id: 'agents', icon: 'AI', label: this.agentsLabel, dot: this.agentsDot },\n ];\n }\n\n private selectDestination(destination: MobileDestination) {\n if (\n !shouldEmitMobileDestinationChange(\n this.activeDestination,\n destination,\n this.sheetNavExpanded\n )\n ) {\n return;\n }\n this.dsDestinationChange.emit({ destination });\n }\n\n @Method()\n async focusDestination(destination: MobileDestination | 'sheet-nav') {\n const target = this.el.querySelector<HTMLElement>(\n `#${\n destination === 'sheet-nav'\n ? 'ds-mobile-sheet-nav-trigger'\n : `ds-mobile-bar-${destination}-trigger`\n }`\n );\n target?.focus({ preventScroll: true });\n }\n\n private renderDestination(item: DestinationConfig) {\n const selected = !this.sheetNavExpanded && item.id === this.activeDestination;\n return (\n <button\n id={`ds-mobile-bar-${item.id}-trigger`}\n type=\"button\"\n class={{\n 'mobile-bar-nav__item': true,\n 'mobile-bar-nav__item--selected': selected,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n }}\n aria-label={item.label}\n aria-current={selected ? 'page' : undefined}\n onClick={() => this.selectDestination(item.id)}\n >\n <span class=\"mobile-bar-nav__icon ds-interaction-fill__content\">\n <ds-icon name={item.icon} size=\"lg\" color=\"inherit\" />\n {item.dot && (\n <ds-badge class=\"mobile-bar-nav__dot\" variant=\"dot\" label=\"\" aria-hidden=\"true\" />\n )}\n </span>\n </button>\n );\n }\n\n render() {\n const [currentArea, ...tools] = this.destinationConfig();\n\n return (\n <Host>\n <nav class=\"mobile-bar-nav\" aria-label=\"Primary\">\n <div class=\"mobile-bar-nav__group mobile-bar-nav__group--context\">\n <button\n id=\"ds-mobile-sheet-nav-trigger\"\n type=\"button\"\n class={{\n 'mobile-bar-nav__item': true,\n 'mobile-bar-nav__item--selected': this.sheetNavExpanded,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n }}\n aria-label={this.menuLabel}\n aria-expanded={String(this.sheetNavExpanded)}\n aria-controls=\"ds-mobile-sheet-nav\"\n onClick={() => this.dsSheetNavToggle.emit(!this.sheetNavExpanded)}\n >\n <span class=\"mobile-bar-nav__icon ds-interaction-fill__content\">\n <ds-icon\n name={this.sheetNavExpanded ? 'Cross' : 'Hamburger'}\n size=\"lg\"\n color=\"inherit\"\n />\n </span>\n </button>\n <span class=\"mobile-bar-nav__divider\" aria-hidden=\"true\" />\n {this.renderDestination(currentArea)}\n </div>\n <div class=\"mobile-bar-nav__group mobile-bar-nav__group--tools\">\n {tools.map(item => this.renderDestination(item))}\n </div>\n </nav>\n </Host>\n );\n }\n}\n",
|
|
325
|
+
"type": "registry:ui"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"path": "src/wc/components/MobileBarNav/mobile-bar-nav-types.ts",
|
|
329
|
+
"content": "import type { MobileDestination } from '../../shell/shell-responsive';\n\nexport interface MobileBarNavDestinationDetail {\n destination: MobileDestination;\n}\n",
|
|
330
|
+
"type": "registry:ui"
|
|
331
|
+
}
|
|
332
|
+
]
|
|
333
|
+
}
|