@dialpad/dialtone-vue 4.9.0 → 4.10.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/{Combobox-WsLvegw6.js → Combobox-DP8tbe6x.js} +1 -1
- package/dist/{Combobox-WsLvegw6.js.map → Combobox-DP8tbe6x.js.map} +1 -1
- package/dist/{Combobox-96zAPv6d.cjs → Combobox-DdBIRmeH.cjs} +1 -1
- package/dist/{Combobox-96zAPv6d.cjs.map → Combobox-DdBIRmeH.cjs.map} +1 -1
- package/dist/{Datepicker-D-Lgvthq.js → Datepicker-CNFVUyyK.js} +1 -1
- package/dist/{Datepicker-D-Lgvthq.js.map → Datepicker-CNFVUyyK.js.map} +1 -1
- package/dist/{Datepicker-DmKOuf5y.cjs → Datepicker-Df6uR0r_.cjs} +1 -1
- package/dist/{Datepicker-DmKOuf5y.cjs.map → Datepicker-Df6uR0r_.cjs.map} +1 -1
- package/dist/{EmojiPicker-D46lLRMp.js → EmojiPicker-B7AKJlAM.js} +1 -1
- package/dist/{EmojiPicker-D46lLRMp.js.map → EmojiPicker-B7AKJlAM.js.map} +1 -1
- package/dist/{EmojiPicker-CXFd-iVj.cjs → EmojiPicker-KbIfc-GH.cjs} +1 -1
- package/dist/{EmojiPicker-CXFd-iVj.cjs.map → EmojiPicker-KbIfc-GH.cjs.map} +1 -1
- package/dist/{FilterPill-IBlswKiK.js → FilterPill-BR7FAmMG.js} +2 -2
- package/dist/{FilterPill-IBlswKiK.js.map → FilterPill-BR7FAmMG.js.map} +1 -1
- package/dist/FilterPill-DwapR9JK.cjs +2 -0
- package/dist/{FilterPill-DY9T19XB.cjs.map → FilterPill-DwapR9JK.cjs.map} +1 -1
- package/dist/{ForceLinkify-DhmBEXhe.cjs → ForceLinkify-D4FBhBxD.cjs} +1 -1
- package/dist/{ForceLinkify-DhmBEXhe.cjs.map → ForceLinkify-D4FBhBxD.cjs.map} +1 -1
- package/dist/{ForceLinkify-53Zegx7z.js → ForceLinkify-wTXS_wJS.js} +1 -1
- package/dist/{ForceLinkify-53Zegx7z.js.map → ForceLinkify-wTXS_wJS.js.map} +1 -1
- package/dist/{MarkdownRenderer-Cnbn7gje.js → MarkdownRenderer-3CVbodrq.js} +1 -1
- package/dist/{MarkdownRenderer-Cnbn7gje.js.map → MarkdownRenderer-3CVbodrq.js.map} +1 -1
- package/dist/{MarkdownRenderer-a12waV7r.cjs → MarkdownRenderer-CaBjENW6.cjs} +1 -1
- package/dist/{MarkdownRenderer-a12waV7r.cjs.map → MarkdownRenderer-CaBjENW6.cjs.map} +1 -1
- package/dist/{Resizable-DdP6uPio.cjs → Resizable-BQsHIvDC.cjs} +2 -2
- package/dist/{Resizable-DdP6uPio.cjs.map → Resizable-BQsHIvDC.cjs.map} +1 -1
- package/dist/{Resizable-Ddsm-H14.js → Resizable-F6PU5oKB.js} +3 -3
- package/dist/{Resizable-Ddsm-H14.js.map → Resizable-F6PU5oKB.js.map} +1 -1
- package/dist/{ResizableHandle-DQduVxrG.js → ResizableHandle-CqIIQvza.js} +3 -3
- package/dist/{ResizableHandle-DQduVxrG.js.map → ResizableHandle-CqIIQvza.js.map} +1 -1
- package/dist/{ResizableHandle-_ldmhyEw.cjs → ResizableHandle-VBoudEYy.cjs} +2 -2
- package/dist/{ResizableHandle-_ldmhyEw.cjs.map → ResizableHandle-VBoudEYy.cjs.map} +1 -1
- package/dist/{ResizableUtils-BptSHmLg.cjs → ResizableUtils-CZdVSd6q.cjs} +1 -1
- package/dist/{ResizableUtils-BptSHmLg.cjs.map → ResizableUtils-CZdVSd6q.cjs.map} +1 -1
- package/dist/{ResizableUtils-BIRNCdKB.js → ResizableUtils-CrBOa8js.js} +1 -1
- package/dist/{ResizableUtils-BIRNCdKB.js.map → ResizableUtils-CrBOa8js.js.map} +1 -1
- package/dist/{RichTextEditor-DhNhx5AH.js → RichTextEditor-DLiJCPI6.js} +5 -5
- package/dist/{RichTextEditor-DhNhx5AH.js.map → RichTextEditor-DLiJCPI6.js.map} +1 -1
- package/dist/{RichTextEditor-CjyvDYID.cjs → RichTextEditor-ECmStZDK.cjs} +2 -2
- package/dist/{RichTextEditor-CjyvDYID.cjs.map → RichTextEditor-ECmStZDK.cjs.map} +1 -1
- package/dist/{Scroller-D7MjyXun.js → Scroller-D6f0HvIT.js} +1 -1
- package/dist/{Scroller-D7MjyXun.js.map → Scroller-D6f0HvIT.js.map} +1 -1
- package/dist/{Scroller-Bt8TUghI.cjs → Scroller-EIHN3a26.cjs} +1 -1
- package/dist/{Scroller-Bt8TUghI.cjs.map → Scroller-EIHN3a26.cjs.map} +1 -1
- package/dist/{Slider-CfvbLBv5.cjs → Slider-BDgY7gNR.cjs} +2 -2
- package/dist/{Slider-CfvbLBv5.cjs.map → Slider-BDgY7gNR.cjs.map} +1 -1
- package/dist/{Slider-Xd5Aj9nS.js → Slider-Bg9KspmL.js} +3 -3
- package/dist/{Slider-Xd5Aj9nS.js.map → Slider-Bg9KspmL.js.map} +1 -1
- package/dist/Text-5MobHF6z.js +404 -0
- package/dist/Text-5MobHF6z.js.map +1 -0
- package/dist/Text-DNVNZree.cjs +2 -0
- package/dist/Text-DNVNZree.cjs.map +1 -0
- package/dist/{TextList-DUL3NwQp.cjs → TextList-1_ZM5zE3.cjs} +1 -1
- package/dist/{TextList-DUL3NwQp.cjs.map → TextList-1_ZM5zE3.cjs.map} +1 -1
- package/dist/{TextList-CkY7OAl2.js → TextList-DIj84CPZ.js} +1 -1
- package/dist/{TextList-CkY7OAl2.js.map → TextList-DIj84CPZ.js.map} +1 -1
- package/dist/{TextListItem-D96feMQf.js → TextListItem-BhmijfFO.js} +1 -1
- package/dist/{TextListItem-D96feMQf.js.map → TextListItem-BhmijfFO.js.map} +1 -1
- package/dist/{TextListItem-BI9M_J8Y.cjs → TextListItem-CVjrHr2_.cjs} +1 -1
- package/dist/{TextListItem-BI9M_J8Y.cjs.map → TextListItem-CVjrHr2_.cjs.map} +1 -1
- package/dist/{Toast-BXvUrvd_.cjs → Toast--W8p7jzA.cjs} +1 -1
- package/dist/{Toast-BXvUrvd_.cjs.map → Toast--W8p7jzA.cjs.map} +1 -1
- package/dist/{Toast-DmzQrYtG.js → Toast-4nsu1oxP.js} +1 -1
- package/dist/{Toast-DmzQrYtG.js.map → Toast-4nsu1oxP.js.map} +1 -1
- package/dist/{UseResizableCalculations-k6TSRlpa.js → UseResizableCalculations-B-yTU9ZI.js} +2 -2
- package/dist/{UseResizableCalculations-k6TSRlpa.js.map → UseResizableCalculations-B-yTU9ZI.js.map} +1 -1
- package/dist/{UseResizableCalculations-BNcxJfef.cjs → UseResizableCalculations-CahDXDOn.cjs} +2 -2
- package/dist/{UseResizableCalculations-BNcxJfef.cjs.map → UseResizableCalculations-CahDXDOn.cjs.map} +1 -1
- package/dist/component-documentation.json +1 -1
- package/dist/components/Banner/Banner.vue.d.ts +53 -1
- package/dist/components/Banner/Banner.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts +53 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +53 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +0 -3
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts +53 -1
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts +53 -1
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPill.vue.d.ts +159 -6
- package/dist/components/FilterPill/FilterPill.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +53 -1
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.vue.d.ts +53 -1
- package/dist/components/InputGroup/InputGroup.vue.d.ts.map +1 -1
- package/dist/components/KeyboardShortcut/KeyboardShortcut.vue.d.ts +53 -1
- package/dist/components/Modal/Modal.vue.d.ts +53 -1
- package/dist/components/Modal/Modal.vue.d.ts.map +1 -1
- package/dist/components/Notice/Notice.vue.d.ts +53 -1
- package/dist/components/Notice/Notice.vue.d.ts.map +1 -1
- package/dist/components/Notice/NoticeContent.vue.d.ts +53 -1
- package/dist/components/Notice/NoticeContent.vue.d.ts.map +1 -1
- package/dist/components/Popover/Popover.vue.d.ts.map +1 -1
- package/dist/components/Radio/Radio.vue.d.ts +53 -1
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/Mentions/MentionSuggestion.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/SlashCommand/SlashCommandSuggestion.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts +53 -1
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts +53 -1
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButton.vue.d.ts +0 -3
- package/dist/components/SplitButton/SplitButton.vue.d.ts.map +1 -1
- package/dist/components/Text/Text.vue.d.ts +53 -1
- package/dist/components/Text/Text.vue.d.ts.map +1 -1
- package/dist/components/Text/TextConstants.d.ts +2 -0
- package/dist/components/Text/TextConstants.d.ts.map +1 -1
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/Text/modules/SlideViewport.vue.d.ts +38 -0
- package/dist/components/Text/modules/SlideViewport.vue.d.ts.map +1 -0
- package/dist/components/Text/modules/slide.d.ts +19 -0
- package/dist/components/Text/modules/slide.d.ts.map +1 -0
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts +53 -1
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts.map +1 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts +53 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts.map +1 -1
- package/dist/components/Toast/Toast.vue.d.ts +212 -4
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +27 -28
- package/dist/{floating-ui.dom-BUeA6pp4.js → floating-ui.dom-Cqf6X2Wc.js} +1 -1
- package/dist/{floating-ui.dom-BUeA6pp4.js.map → floating-ui.dom-Cqf6X2Wc.js.map} +1 -1
- package/dist/{floating-ui.dom-DF2uE3n8.cjs → floating-ui.dom-n1CheoWj.cjs} +1 -1
- package/dist/{floating-ui.dom-DF2uE3n8.cjs.map → floating-ui.dom-n1CheoWj.cjs.map} +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/lib/checkbox/checkbox.cjs +1 -1
- package/dist/lib/checkbox/checkbox.cjs.map +1 -1
- package/dist/lib/checkbox/checkbox.js +1 -1
- package/dist/lib/combobox/combobox.cjs +1 -1
- package/dist/lib/combobox/combobox.js +1 -1
- package/dist/lib/combobox/index.cjs +1 -1
- package/dist/lib/combobox/index.js +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.js +1 -1
- package/dist/lib/datepicker/datepicker.cjs +1 -1
- package/dist/lib/datepicker/datepicker.js +1 -1
- package/dist/lib/datepicker/index.cjs +1 -1
- package/dist/lib/datepicker/index.js +1 -1
- package/dist/lib/dropdown/dropdown-list.cjs +1 -1
- package/dist/lib/dropdown/dropdown-list.cjs.map +1 -1
- package/dist/lib/dropdown/dropdown-list.js +1 -1
- package/dist/lib/dropdown/dropdown.cjs +1 -1
- package/dist/lib/dropdown/dropdown.cjs.map +1 -1
- package/dist/lib/dropdown/dropdown.js +5 -15
- package/dist/lib/dropdown/dropdown.js.map +1 -1
- package/dist/lib/emoji-picker/emoji-picker.cjs +1 -1
- package/dist/lib/emoji-picker/emoji-picker.js +1 -1
- package/dist/lib/emoji-picker/index.cjs +1 -1
- package/dist/lib/emoji-picker/index.js +1 -1
- package/dist/lib/empty-state/empty-state.cjs +1 -1
- package/dist/lib/empty-state/empty-state.cjs.map +1 -1
- package/dist/lib/empty-state/empty-state.js +1 -1
- package/dist/lib/filter-pill/filter-pill.cjs +1 -1
- package/dist/lib/filter-pill/filter-pill.js +1 -1
- package/dist/lib/filter-pill/index.cjs +1 -1
- package/dist/lib/filter-pill/index.js +1 -1
- package/dist/lib/input/input.cjs +1 -1
- package/dist/lib/input/input.cjs.map +1 -1
- package/dist/lib/input/input.js +1 -1
- package/dist/lib/input-group/input-group.cjs +1 -1
- package/dist/lib/input-group/input-group.cjs.map +1 -1
- package/dist/lib/input-group/input-group.js +1 -1
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.cjs +1 -1
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.cjs.map +1 -1
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.js +1 -1
- package/dist/lib/kitchen-sink/kitchen-sink-view.cjs +1 -1
- package/dist/lib/kitchen-sink/kitchen-sink-view.cjs.map +1 -1
- package/dist/lib/kitchen-sink/kitchen-sink-view.js +1 -1
- package/dist/lib/modal/modal.cjs +1 -1
- package/dist/lib/modal/modal.cjs.map +1 -1
- package/dist/lib/modal/modal.js +1 -1
- package/dist/lib/notice/notice-content.cjs +1 -1
- package/dist/lib/notice/notice-content.cjs.map +1 -1
- package/dist/lib/notice/notice-content.js +1 -1
- package/dist/lib/popover/popover.cjs +1 -1
- package/dist/lib/popover/popover.cjs.map +1 -1
- package/dist/lib/popover/popover.js +6 -1
- package/dist/lib/popover/popover.js.map +1 -1
- package/dist/lib/radio/radio.cjs +1 -1
- package/dist/lib/radio/radio.cjs.map +1 -1
- package/dist/lib/radio/radio.js +1 -1
- package/dist/lib/resizable/index.cjs +1 -1
- package/dist/lib/resizable/index.js +3 -3
- package/dist/lib/resizable/resizable-handle.cjs +1 -1
- package/dist/lib/resizable/resizable-handle.js +1 -1
- package/dist/lib/resizable/resizable-panel.cjs +1 -1
- package/dist/lib/resizable/resizable-panel.js +1 -1
- package/dist/lib/resizable/resizable.cjs +1 -1
- package/dist/lib/resizable/resizable.js +1 -1
- package/dist/lib/rich-text-editor/force-linkify.cjs +1 -1
- package/dist/lib/rich-text-editor/force-linkify.js +1 -1
- package/dist/lib/rich-text-editor/index.cjs +1 -1
- package/dist/lib/rich-text-editor/index.js +1 -1
- package/dist/lib/rich-text-editor/markdown-renderer.cjs +1 -1
- package/dist/lib/rich-text-editor/markdown-renderer.js +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/lib/scroller/index.cjs +1 -1
- package/dist/lib/scroller/index.js +1 -1
- package/dist/lib/scroller/scroller.cjs +1 -1
- package/dist/lib/scroller/scroller.js +1 -1
- package/dist/lib/select-menu/select-menu.cjs +1 -1
- package/dist/lib/select-menu/select-menu.cjs.map +1 -1
- package/dist/lib/select-menu/select-menu.js +1 -1
- package/dist/lib/slider/index.cjs +1 -1
- package/dist/lib/slider/index.js +1 -1
- package/dist/lib/slider/slider.cjs +1 -1
- package/dist/lib/slider/slider.js +1 -1
- package/dist/lib/text/index.cjs +1 -1
- package/dist/lib/text/index.js +3 -3
- package/dist/lib/text/text-constants.cjs +1 -1
- package/dist/lib/text/text-constants.cjs.map +1 -1
- package/dist/lib/text/text-constants.js +5 -4
- package/dist/lib/text/text-constants.js.map +1 -1
- package/dist/lib/text/text.cjs +1 -2
- package/dist/lib/text/text.js +2 -184
- package/dist/lib/text-list/index.cjs +1 -1
- package/dist/lib/text-list/index.js +2 -2
- package/dist/lib/text-list/text-list-item.cjs +1 -1
- package/dist/lib/text-list/text-list-item.js +1 -1
- package/dist/lib/text-list/text-list.cjs +1 -1
- package/dist/lib/text-list/text-list.js +1 -1
- package/dist/lib/toast/index.cjs +1 -1
- package/dist/lib/toast/index.js +1 -1
- package/dist/lib/toast/toast.cjs +1 -1
- package/dist/lib/toast/toast.js +1 -1
- package/package.json +9 -4
- package/dist/FilterPill-DY9T19XB.cjs +0 -2
- package/dist/lib/text/text.cjs.map +0 -1
- package/dist/lib/text/text.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/constants/index.cjs`),t=require(`./common/validators/index.cjs`),n=require(`./common/utils/index.cjs`),r=require(`./_plugin-vue_export-helper-D8jCH6HB.cjs`),i=require(`./mode_constants-CzYJW9ua.cjs`),a=require(`./lib/text/text.cjs`),o=require(`./localization/index.cjs`),s=require(`./lib/button/button-constants.cjs`),c=require(`./lib/button/button.cjs`),l=require(`./lib/checkbox/checkbox.cjs`),u=require(`./lib/checkbox-group/checkbox-group.cjs`),d=require(`./lib/list-item/list-item.cjs`),f=require(`./lib/stack/stack.cjs`),p=require(`./lib/popover/popover-constants.cjs`),m=require(`./lib/popover/popover.cjs`),h=require(`./lib/dropdown/dropdown.cjs`),g=require(`./lib/filter-pill/filter-pill-constants.cjs`),_=require(`./lib/filter-pill/filter-pill-controlled.cjs`),v=require(`./lib/list-item-group/list-item-group.cjs`);let y=require(`vue`),b=require(`@dialpad/dialtone-icons/vue`);var x={key:0,role:`none`,class:`d-filter-pill__menu-group`},S=(0,y.defineComponent)({name:`DtFilterPillOptionGroup`,__name:`FilterPillOptionGroup`,props:{heading:{type:String,default:null}},setup(e){return(t,n)=>e.heading?((0,y.openBlock)(),(0,y.createElementBlock)(`li`,x,[(0,y.createVNode)((0,y.unref)(v.default),{heading:e.heading,"heading-class":`d-filter-pill__menu-heading`},{heading:(0,y.withCtx)(()=>[(0,y.createVNode)((0,y.unref)(a.default),{variant:`label-xs`,size:100,strength:`medium`,tone:`tertiary`,density:500},{default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(e.heading),1)]),_:1})]),default:(0,y.withCtx)(()=>[(0,y.renderSlot)(t.$slots,`default`)]),_:3},8,[`heading`])])):(0,y.renderSlot)(t.$slots,`default`,{key:1})}}),C={name:`DtFilterPill`,components:{DtCheckboxGroup:u.default,DtCheckbox:l.default,DtPopover:m.default,DtButton:c.default,DtIconClose:b.DtIconClose,DtIconCheck:b.DtIconCheck,DtIconChevronDown:b.DtIconChevronDown,DtDropdown:h.default,DtFilterPillOptionGroup:S,DtListItem:d.default,DtStack:f.default,DtText:a.default},mixins:[_.default],props:{options:{type:Array,default:void 0},selected:{type:[String,Array],default:void 0},neutralValue:{type:String,default:void 0},open:{type:[Boolean,null],default:null},anchorEndClass:{type:[String,Array,Object],default:``},optionEndClass:{type:[String,Array,Object],default:``},headerContentClass:{type:[String,Array,Object],default:``},useDropdown:{type:Boolean,default:!1},deferSelection:{type:Boolean,default:!1},modelValue:{type:Array,default:()=>[]},startTooltipText:{type:String,default:``},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},showClear:{type:Boolean,default:!0},label:{type:String,default:void 0},endTooltipText:{type:String,default:``},popoverAppendTo:{type:[e.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>p.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},popoverFallbackPlacements:{type:Array,default:()=>[`auto`]},popoverMaxHeight:{type:String,default:``},overlayMinInlineSize:{type:String,default:`anchor`,validator:t.ordinalSizeValidator(g.FILTER_PILL_OVERLAY_MIN_INLINE_SIZE_VALUES)},popoverMaxWidth:{type:String,default:``},popoverPadding:{type:String,default:void 0,validator:e=>Object.keys(p.POPOVER_PADDING_CLASSES).some(t=>t===e)},popoverPlacement:{type:String,default:`bottom-start`},labelClass:{type:[String,Array,Object],default:``},popoverContentClass:{type:[String,Array,Object],default:``},popoverHeaderClass:{type:[String,Array,Object],default:``},popoverFooterClass:{type:[String,Array,Object],default:``},popoverDialogClass:{type:[String,Array,Object],default:``},dropdownListClass:{type:[String,Array,Object],default:``},contentMode:i.t,size:{type:[String,Number],default:200,validator:t.ordinalSizeValidator(s.BUTTON_SIZE_MODIFIERS)}},emits:[`update:selected`,`selection-change`,`update:open`,`opened`,`clear`,`open`,`update:modelValue`,`apply`],data(){return{isOpen:!1,i18n:new o.DialtoneLocalization,filters:Array.isArray(this.options)?[]:this.modelValue,pendingFilters:null,overlayResizeObserver:null}},computed:{overlayUseDropdown(){return this.controlledAtBirth?this.controlledDropdown:this.useDropdown},overlayComponent(){return this.overlayUseDropdown?`dt-dropdown`:`dt-popover`},overlayProps(){let e={"append-to":this.popoverAppendTo,"fallback-placements":this.popoverFallbackPlacements,"max-height":this.popoverMaxHeight,"max-width":this.popoverMaxWidth,modal:!0,placement:this.popoverPlacement};if(this.controlledAtBirth&&(e.visibilityChangeCallback=this.onControlledVisibility,e.forwardAnchorArrowKeys=!0),this.overlayUseDropdown)e[`list-class`]=this.dropdownListClass;else{let t=this.popoverPadding===void 0;e.padding=t?`none`:this.popoverPadding,e[`content-class`]=t?[`d-filter-pill__popover-content`,this.popoverContentClass]:this.popoverContentClass,e[`header-wrapper-class`]=t?[p.POPOVER_HEADER_FOOTER_PADDING_CLASSES.large,this.popoverHeaderClass]:this.popoverHeaderClass,e[`header-class`]=this.headerContentClass,e[`footer-wrapper-class`]=t?[p.POPOVER_HEADER_FOOTER_PADDING_CLASSES.large,this.popoverFooterClass]:this.popoverFooterClass,e[`dialog-class`]=this.popoverDialogClass}return e},buttonKind(){return this.isActive&&!this.disabled?`default`:`muted`},resolvedStartTooltipText(){return this.readOnly?this.startTooltipText||this.i18n.$t(`DIALTONE_FILTER_PILL_READ_ONLY_TOOLTIP`):this.startTooltipText},clearButtonAriaLabel(){return this.endTooltipText||this.i18n.$t(`DIALTONE_FILTER_PILL_CLEAR_BUTTON_LABEL`)},clearButtonTitle(){if(!this.endTooltipText)return this.clearButtonAriaLabel},activeFilters(){return this.filters.filter(e=>e.active).map(e=>e.name)},allFiltersActive(){return this.filters.length>1&&this.activeFilters.length===this.filters.length},activeFilterList(){return this.allFiltersActive?`All`:this.activeFilters[0]??``},activeFilterLabel(){return this.allFiltersActive?this.i18n.$t(`DIALTONE_FILTER_PILL_ALL_LABEL`):this.activeFilterList},activeFilterOverflowTitle(){let e=this.controlledAtBirth?this.controlledState.values.length-1:this.activeFilters.length-1;return this.i18n.$t(`DIALTONE_FILTER_PILL_OVERFLOW_TITLE`,{count:e})},activeFilterOverflow(){return this.activeFilters.length<=1||this.allFiltersActive?``:`+`+(this.activeFilters.length-1)},isActive(){return this.controlledAtBirth?this.controlledState.valid&&this.controlledState.isActive:this.activeFilterList.length>0},hasClear(){return this.controlledAtBirth?!this.readOnly&&this.showClear&&this.controlledContractValid&&this.controlledState.valid&&this.isActive:!this.readOnly&&this.showClear&&this.activeFilterList.length>0},displayFilters(){return this.deferSelection&&this.pendingFilters?this.pendingFilters:this.filters},pendingActiveFilters(){return this.pendingFilters?this.pendingFilters.filter(e=>e.active).map(e=>e.name):[]},cancelButtonLabel(){return this.i18n.$t(`DIALTONE_FILTER_PILL_CANCEL_BUTTON_LABEL`)},applyButtonLabel(){return this.i18n.$t(`DIALTONE_FILTER_PILL_APPLY_BUTTON_LABEL`)},clearIconSize(){return String(this.size)===`100`?`100`:s.BUTTON_ICON_SIZES[String(this.size)]}},watch:{overlayMinInlineSize:{handler:`observeOverlayAnchor`,flush:`post`},overlayUseDropdown:{handler:`observeOverlayAnchor`,flush:`post`},hasClear:{handler:`observeOverlayAnchor`,flush:`post`},popoverMaxWidth:{handler:`syncOverlayMinInlineSize`,flush:`post`},isOpen:[{handler:`syncOverlayMinInlineSize`,flush:`post`},function(e){this.controlledAtBirth||(this.$emit(`open`,e),this.deferSelection&&(e?this.pendingFilters=JSON.parse(JSON.stringify(this.filters)):this.pendingFilters=null))}],filters:{deep:!0,handler(e){this.controlledAtBirth||this.$emit(`update:modelValue`,e)}}},mounted(){this.observeOverlayAnchor(),!this.controlledAtBirth&&!(this.modelValue?.length||this.$slots.content)&&console.warn(`Please provide content through the v-model or the "content" slot.`),this.deferSelection&&this.useDropdown&&console.warn(`deferSelection has no effect when useDropdown is true.`)},beforeUnmount(){this.overlayResizeObserver?.disconnect()},methods:{hasSlotContent:n.hasSlotContent,observeOverlayAnchor(){this.overlayResizeObserver?.disconnect(),this.overlayResizeObserver=null,this.overlayMinInlineSize===`anchor`&&typeof ResizeObserver<`u`&&(this.overlayResizeObserver=new ResizeObserver(()=>this.syncOverlayMinInlineSize()),[this.$el,...this.getAnchorControls()].forEach(e=>this.overlayResizeObserver.observe(e))),this.syncOverlayMinInlineSize()},getAnchorControls(){return[this.$el.querySelector(`[data-qa="dt-filter-pill__button"]`),this.$refs.clearButton?.$el].filter(Boolean)},measureAnchorInlineSize(){let e=this.getAnchorControls();if(!e.length)return 0;let[t,n]=/^(vertical|sideways)/.test(getComputedStyle(this.$el).writingMode)?[`top`,`bottom`]:[`left`,`right`],r=e.map(e=>e.getBoundingClientRect());return Math.max(...r.map(e=>e[n]))-Math.min(...r.map(e=>e[t]))},resolveOverlayMinInlineSize(){let e=String(this.overlayMinInlineSize??`0`);return e=e===`anchor`?`${this.measureAnchorInlineSize()}px`:e===`0`?`0px`:`var(--dt-layout-${e})`,e&&this.popoverMaxWidth&&this.popoverMaxWidth!==`none`?`min(${e}, ${this.popoverMaxWidth})`:e},syncOverlayMinInlineSize(){let e=this.$refs.overlay;if(!e)return;let t=this.overlayUseDropdown?e.$refs.popover:e,n=t?.popoverContentEl;if(!n)return;let r=this.resolveOverlayMinInlineSize();n.style.minInlineSize!==r&&(n.style.minInlineSize=r,t.tip?.popperInstance?.update())},clearFilter(e){if(this.controlledAtBirth){let t=this.controlledDropdown?this.neutralValue??null:[];this.controlledDraft=null,this.commitControlled(t,`clear`,!0,e),this.reconcileCheckboxes();return}this.filters.forEach(e=>delete e.active),this.$emit(`clear`,e)},openPopover(){if(this.controlledAtBirth){this.requestControlledOpen(!0);return}this.readOnly||(this.isOpen=!0)},selectFilter(e,t){this.filters.forEach(t=>{t.active=t===e}),t()},applySelection(){if(this.controlledAtBirth)return this.applyControlledSelection();this.pendingFilters&&(this.filters.forEach((e,t)=>{this.pendingFilters[t]?e.active=this.pendingFilters[t].active:delete e.active}),this.$emit(`apply`),this.isOpen=!1)},cancelSelection(){if(this.controlledAtBirth){this.closeControlled();return}this.isOpen=!1}}},w={class:`sr-only`,"data-qa":`dt-filter-pill__accessible-label`},T={key:0,class:`d-filter-pill__label-start`,"data-qa":`dt-filter-pill__label-start`,"aria-hidden":`true`},E=[`title`],D=[`title`,`textContent`],O=[`title`,`textContent`],k=[`title`,`textContent`],A=[`id`];function j(e,t,n,r,i,a){let o=(0,y.resolveComponent)(`dt-icon-chevron-down`),s=(0,y.resolveComponent)(`dt-button`),c=(0,y.resolveComponent)(`dt-checkbox`),l=(0,y.resolveComponent)(`dt-checkbox-group`),u=(0,y.resolveComponent)(`dt-stack`),d=(0,y.resolveComponent)(`dt-text`),f=(0,y.resolveComponent)(`dt-icon-check`),p=(0,y.resolveComponent)(`dt-list-item`),m=(0,y.resolveComponent)(`dt-filter-pill-option-group`),h=(0,y.resolveComponent)(`dt-icon-close`),g=(0,y.resolveDirective)(`dt-tooltip`);return(0,y.openBlock)(),(0,y.createElementBlock)(`div`,(0,y.mergeProps)({class:[`d-filter-pill`,{"d-filter-pill--read-only":n.readOnly}]},e.legacyRootAttrs(),{"data-qa":`dt-filter-pill`}),[((0,y.openBlock)(),(0,y.createBlock)((0,y.resolveDynamicComponent)(a.overlayComponent),(0,y.mergeProps)({ref:`overlay`,open:i.isOpen},a.overlayProps,{"aria-label":e.controlledAtBirth&&!e.$slots.content?n.label:void 0,"content-mode":n.contentMode,"onUpdate:open":e.onOverlayTerminalOpen,onOpened:e.onOverlayOpened,onKeydown:e.onOverlayKeydown}),(0,y.createSlots)({anchor:(0,y.withCtx)(t=>[(0,y.withDirectives)(((0,y.openBlock)(),(0,y.createBlock)(s,(0,y.mergeProps)({ref:`primaryButton`},e.anchorAttributes(t),{active:a.isActive,"aria-disabled":n.readOnly||void 0,class:[`d-filter-pill__primary`,{"d-filter-pill--selected":a.isActive}],disabled:n.disabled,kind:a.buttonKind,size:n.size,"data-qa":`dt-filter-pill__button`,importance:`outlined`,onClick:a.openPopover,onKeydown:(0,y.withKeys)((0,y.withModifiers)(e.onAnchorArrow,[`prevent`]),[`up`,`down`])}),(0,y.createSlots)({default:(0,y.withCtx)(()=>[(0,y.createElementVNode)(`span`,{class:(0,y.normalizeClass)([`d-filter-pill__label`,n.labelClass]),"data-qa":`dt-filter-pill__label`},[e.controlledAtBirth?(0,y.renderSlot)(e.$slots,`default`,(0,y.normalizeProps)((0,y.mergeProps)({key:0},e.controlledAnchorBindings)),()=>[(0,y.createElementVNode)(`span`,w,(0,y.toDisplayString)(e.controlledAccessibleLabel),1),e.controlledDropdown||!a.isActive||n.label?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,T,(0,y.toDisplayString)(e.controlledDropdown||!a.isActive?e.controlledDisplayLabel:n.label),1)):(0,y.createCommentVNode)(``,!0),!e.controlledDropdown&&a.isActive?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:1,class:(0,y.normalizeClass)([`d-filter-pill__label-end`,{"d-filter-pill__label-end--standalone":!n.label}]),"data-qa":`dt-filter-pill__label-end`,"aria-hidden":`true`},(0,y.toDisplayString)(e.controlledDisplayLabel),3)):(0,y.createCommentVNode)(``,!0),e.controlledOverflow?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:2,class:`d-filter-pill__label-end-overflow`,"data-qa":`dt-filter-pill__overflow`,title:a.activeFilterOverflowTitle},(0,y.toDisplayString)(e.controlledOverflow),9,E)):(0,y.createCommentVNode)(``,!0),a.hasSlotContent(e.$slots.anchorEnd,e.controlledAnchorBindings)?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:3,class:(0,y.normalizeClass)([`d-filter-pill__anchor-end`,n.anchorEndClass]),"data-qa":`dt-filter-pill__anchor-end`},[(0,y.renderSlot)(e.$slots,`anchorEnd`,(0,y.normalizeProps)((0,y.guardReactiveProps)(e.controlledAnchorBindings)))],2)):(0,y.createCommentVNode)(``,!0)]):(0,y.renderSlot)(e.$slots,`default`,{key:1,label:n.label,filters:i.filters,activeFilters:a.activeFilters,activeFilterList:a.activeFilterList,activeFilterOverflow:a.activeFilterOverflow},()=>[(0,y.createElementVNode)(`span`,{class:`d-filter-pill__label-start`,title:n.label,textContent:(0,y.toDisplayString)(n.label)},null,8,D),a.activeFilterList?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:0,class:`d-filter-pill__label-end`,title:a.activeFilterLabel,textContent:(0,y.toDisplayString)(a.activeFilterLabel)},null,8,O)):(0,y.createCommentVNode)(``,!0),a.activeFilterOverflow?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:1,class:`d-filter-pill__label-end-overflow`,title:a.activeFilterOverflowTitle,textContent:(0,y.toDisplayString)(a.activeFilterOverflow)},null,8,k)):(0,y.createCommentVNode)(``,!0)])],2)]),_:2},[e.$slots.startIcon?{name:`startIcon`,fn:(0,y.withCtx)(({iconSize:t})=>[(0,y.renderSlot)(e.$slots,`startIcon`,{iconSize:t})]),key:`0`}:void 0,n.readOnly?void 0:{name:`endIcon`,fn:(0,y.withCtx)(({iconSize:e})=>[(0,y.createVNode)(o,{size:e,class:`d-filter-pill__icon`,"data-qa":`dt-filter-pill__icon`},null,8,[`size`])]),key:`1`}]),1040,[`active`,`aria-disabled`,`class`,`disabled`,`kind`,`size`,`onClick`,`onKeydown`])),[[g,a.resolvedStartTooltipText]])]),_:2},[a.overlayUseDropdown?void 0:{name:`content`,fn:(0,y.withCtx)(({close:t})=>[e.controlledAtBirth?(0,y.renderSlot)(e.$slots,`content`,(0,y.normalizeProps)((0,y.mergeProps)({key:0},e.controlledContentBindings)),()=>[(0,y.createVNode)(l,{"model-value":e.checkboxRenderValues,"aria-label":n.label,name:n.label||`filter-pill`,disabled:!e.controlledCanSelect},{default:(0,y.withCtx)(()=>[((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(e.controlledState.options,t=>((0,y.openBlock)(),(0,y.createBlock)(c,{id:e.controlledOptionId(t.value),key:t.value,label:t.label,value:t.value,"data-qa":`dt-filter-pill__checkbox`,"onUpdate:modelValue":n=>e.toggleControlledOption(t.value,n)},{default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(t.label)+` `,1),e.$slots.optionEnd?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:0,class:(0,y.normalizeClass)([`d-filter-pill__option-end`,n.optionEndClass])},[(0,y.renderSlot)(e.$slots,`optionEnd`,{option:t,selected:e.controlledRowSelected(t.value)})],2)):(0,y.createCommentVNode)(``,!0)]),_:2},1032,[`id`,`label`,`value`,`onUpdate:modelValue`]))),128))]),_:3},8,[`model-value`,`aria-label`,`name`,`disabled`])]):(0,y.renderSlot)(e.$slots,`content`,{key:1,close:t,apply:a.applySelection,cancel:a.cancelSelection,pendingFilters:i.pendingFilters},()=>[n.modelValue?.length?((0,y.openBlock)(),(0,y.createBlock)(l,{key:0,"model-value":n.deferSelection?a.pendingActiveFilters:a.activeFilters,"aria-label":n.label,name:n.label||`filter-pill`},{default:(0,y.withCtx)(()=>[((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(a.displayFilters,e=>((0,y.openBlock)(),(0,y.createBlock)(c,{key:e.name,label:e.name,value:e.name,"onUpdate:modelValue":t=>e.active=t},null,8,[`label`,`value`,`onUpdate:modelValue`]))),128))]),_:1},8,[`model-value`,`aria-label`,`name`])):(0,y.createCommentVNode)(``,!0)])]),key:`0`},!a.overlayUseDropdown&&e.$slots.headerContent?{name:`headerContent`,fn:(0,y.withCtx)(({close:t})=>[(0,y.renderSlot)(e.$slots,`headerContent`,{close:e.controlledAtBirth?e.closeControlled:t})]),key:`1`}:void 0,!a.overlayUseDropdown&&(n.deferSelection||e.$slots.footerContent)?{name:`footerContent`,fn:(0,y.withCtx)(({close:t})=>[(0,y.renderSlot)(e.$slots,`footerContent`,{close:e.controlledAtBirth?e.closeControlled:t,apply:a.applySelection,cancel:a.cancelSelection},()=>[n.deferSelection?((0,y.openBlock)(),(0,y.createBlock)(u,{key:0,direction:`row`,gap:`400`,justify:`end`,"data-qa":`dt-filter-pill__deferred-footer`},{default:(0,y.withCtx)(()=>[(0,y.createVNode)(s,{importance:`clear`,kind:`muted`,size:200,"data-qa":`dt-filter-pill__cancel-button`,onClick:a.cancelSelection},{default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(a.cancelButtonLabel),1)]),_:1},8,[`onClick`]),(0,y.createVNode)(s,{importance:`primary`,size:200,"data-qa":`dt-filter-pill__apply-button`,onClick:a.applySelection},{default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(a.applyButtonLabel),1)]),_:1},8,[`onClick`])]),_:1})):(0,y.createCommentVNode)(``,!0)])]),key:`2`}:void 0,a.overlayUseDropdown?{name:`list`,fn:(0,y.withCtx)(({close:t})=>[e.controlledAtBirth?(0,y.renderSlot)(e.$slots,`content`,(0,y.normalizeProps)((0,y.mergeProps)({key:0},e.controlledContentBindings)),()=>[e.$slots.headerContent?((0,y.openBlock)(),(0,y.createElementBlock)(`li`,{key:0,role:`presentation`,class:(0,y.normalizeClass)([`d-filter-pill__menu-heading`,n.headerContentClass])},[(0,y.createVNode)(d,{variant:`label-xs`,size:100,strength:`medium`,tone:`tertiary`,density:500},{default:(0,y.withCtx)(()=>[(0,y.renderSlot)(e.$slots,`headerContent`)]),_:3})],2)):(0,y.createCommentVNode)(``,!0),((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(e.controlledState.sections,(t,r)=>((0,y.openBlock)(),(0,y.createBlock)(m,{key:r,heading:t.group},{default:(0,y.withCtx)(()=>[((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(t.rows,t=>((0,y.openBlock)(),(0,y.createBlock)(p,{id:e.controlledOptionId(t.option.value),key:t.option.value,role:`menuitemradio`,"data-qa":`dt-filter-pill__option`,"navigation-type":`arrow-keys`,selected:e.controlledRowSelected(t.option.value),disabled:!e.controlledCanSelect||t.disabled,"aria-describedby":t.description?e.controlledDescriptionId(t.option.value):void 0,onClick:n=>e.selectControlledOption(t.option.value)},(0,y.createSlots)({selected:(0,y.withCtx)(()=>[(0,y.createVNode)(f,{size:`200`,class:(0,y.normalizeClass)({"d-filter-pill__selection-indicator--hidden":!e.controlledRowSelected(t.option.value)}),"aria-hidden":`true`,"data-qa":`dt-filter-pill__selection-indicator`},null,8,[`class`])]),default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(t.option.label)+` `,1)]),_:2},[t.description?{name:`subtitle`,fn:(0,y.withCtx)(()=>[(0,y.createElementVNode)(`span`,{id:e.controlledDescriptionId(t.option.value),"aria-hidden":`true`,"data-qa":`dt-filter-pill__option-description`},(0,y.toDisplayString)(t.description),9,A)]),key:`0`}:void 0,e.$slots.optionEnd?{name:`end`,fn:(0,y.withCtx)(()=>[(0,y.createElementVNode)(`span`,{class:(0,y.normalizeClass)([`d-filter-pill__option-end`,n.optionEndClass])},[(0,y.renderSlot)(e.$slots,`optionEnd`,{option:t.option,selected:e.controlledRowSelected(t.option.value)})],2)]),key:`1`}:void 0]),1032,[`id`,`selected`,`disabled`,`aria-describedby`,`onClick`]))),128))]),_:2},1032,[`heading`]))),128))]):(0,y.renderSlot)(e.$slots,`content`,{key:1,close:t},()=>[((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(i.filters,e=>((0,y.openBlock)(),(0,y.createBlock)(p,{key:e.name,role:`menuitem`,"navigation-type":`arrow-keys`,selected:e.active,onClick:n=>a.selectFilter(e,t)},{selected:(0,y.withCtx)(()=>[(0,y.createVNode)(f,{size:`200`,class:(0,y.normalizeClass)({"d-filter-pill__selection-indicator--hidden":!e.active}),"aria-hidden":`true`,"data-qa":`dt-filter-pill__selection-indicator`},null,8,[`class`])]),default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(e.name)+` `,1)]),_:2},1032,[`selected`,`onClick`]))),128))])]),key:`3`}:void 0]),1040,[`open`,`aria-label`,`content-mode`,`onUpdate:open`,`onOpened`,`onKeydown`])),a.hasClear?(0,y.withDirectives)(((0,y.openBlock)(),(0,y.createBlock)(s,{key:0,ref:`clearButton`,active:a.isActive,"aria-label":a.clearButtonAriaLabel,class:(0,y.normalizeClass)([`d-filter-pill__clear`,{"d-filter-pill__clear--selected":a.isActive}]),disabled:n.disabled,kind:a.buttonKind,size:n.size,title:a.clearButtonTitle,"data-qa":`dt-filter-pill__clear-button`,importance:`outlined`,onClick:a.clearFilter},{icon:(0,y.withCtx)(()=>[(0,y.createVNode)(h,{size:a.clearIconSize},null,8,[`size`])]),_:1},8,[`active`,`aria-label`,`class`,`disabled`,`kind`,`size`,`title`,`onClick`])),[[g,n.endTooltipText]]):(0,y.createCommentVNode)(``,!0)],16)}var M=r.t(C,[[`render`,j]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return M}});
|
|
2
|
-
//# sourceMappingURL=FilterPill-DY9T19XB.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text.cjs","names":[],"sources":["../../../components/Text/Text.vue"],"sourcesContent":["<template>\n <component\n :is=\"as\"\n data-qa=\"dt-text\"\n :class=\"textClasses\"\n :style=\"textStyles\"\n >\n <!-- @slot Default slot for text content -->\n <slot />\n </component>\n</template>\n\n<script>\nimport {\n TEXT_KIND_MODIFIERS,\n TEXT_VARIANT_MODIFIERS,\n TEXT_SIZE_MODIFIERS,\n TEXT_SIZE_MAP,\n TEXT_HEADLINE_ONLY_SIZES,\n TEXT_FONT_SIZE_MODIFIERS,\n TEXT_FAMILY_MODIFIERS,\n TEXT_ITALIC_CLASS,\n TEXT_ALIGN_MODIFIERS,\n TEXT_TONE_MODIFIERS,\n TEXT_NUMERIC_CLASS,\n TEXT_TRUNCATE_CLASS,\n TEXT_LINE_CLAMP_CLASS,\n TEXT_WRAP_MODIFIERS,\n TEXT_BOX_TRIM_MODIFIERS,\n TEXT_STRENGTH_MODIFIERS,\n TEXT_DENSITY_MODIFIERS,\n} from './TextConstants';\n\nconst DEFAULT_SIZE = '300';\nconst SEMANTIC_HEADING_ELEMENTS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n// Module-level flag to emit info only once per session\nlet hasEmittedHeadlineSemanticInfo = false;\n\n// Exported for testing purposes only\nexport const resetHeadlineSemanticInfoFlag = () => {\n hasEmittedHeadlineSemanticInfo = false;\n};\n\n/**\n * Dialtone text primitive that applies typography tokens based on semantic props.\n * @see https://dialtone.dialpad.com/components/text.html\n */\nexport default {\n name: 'DtText',\n\n props: {\n /**\n * HTML tag or component used for rendering.\n * @values span, p, strong, h1, h2, h3, h4, h5, h6, label, div, component\n */\n as: {\n type: String,\n default: 'span',\n },\n\n /**\n * Typography kind mapping to headline/body/label/code token sets.\n * @values headline, body, label, code\n * @deprecated Use variant instead\n */\n kind: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_KIND_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Typography variant mapping to a complete token-backed composition.\n * @values headline-3xl, headline-2xl, headline-xl, headline-lg, headline-md, headline-sm, headline-xs, body-lg, body-md, body-sm, body-xs, label-lg, label-md, label-sm, label-xs, code-lg, code-md, code-sm, code-xs\n */\n variant: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_VARIANT_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Raw font-size token. Must be paired with `variant` for overrides or legacy `kind` for composition size.\n * @values 50, 75, 100, 125, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800\n */\n size: {\n type: [String, Number],\n default: null,\n },\n\n /**\n * Overrides font-family. By default, no font-family class is emitted and text inherits naturally.\n * @values inherit, custom, sans, mono, expressive\n */\n family: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_FAMILY_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Applies italic font style when true.\n */\n italic: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Semantic foreground color.\n * @values primary, secondary, tertiary, muted, disabled, placeholder, critical, critical-strong, positive, positive-strong, warning, info, info-strong, neutral-black, neutral-white\n */\n tone: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_TONE_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Logical text alignment. Requires block/inline-block context.\n * @values start, center, end, justify\n */\n align: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_ALIGN_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Enables single-line truncation (i.e. ellipsis) when true; requires block/inline-block context.\n */\n truncate: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Applies multi-line truncation (i.e. clamp) when greater than zero; requires block/inline-block context.\n */\n maxLines: {\n type: Number,\n default: null,\n validator: (value) => {\n return value === null || (Number.isInteger(value) && value > 0);\n },\n },\n\n /**\n * Renders numeric content with tabular figures.\n */\n numeric: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls text wrapping behavior.\n * @values wrap, nowrap, balance, pretty\n */\n wrap: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_WRAP_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Controls text-box-trim (leading space above/below text). Useful for tight component layouts.\n * @values start, end, both\n */\n textBoxTrim: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_BOX_TRIM_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Overrides font-weight. Applies to any kind/size combination.\n * @values bold, semibold, medium, normal\n */\n strength: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_STRENGTH_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Overrides line-height. Applies to any kind/size combination.\n * @values 100, 200, 300, 400, 500, 600\n */\n density: {\n type: [String, Number],\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_DENSITY_MODIFIERS, value)\n );\n },\n },\n },\n\n computed: {\n textClasses() {\n const classes = ['d-text'];\n const variantClass = this.getVariantClass();\n if (variantClass) {\n classes.push(variantClass);\n }\n\n const fontSizeClass = this.getFontSizeClass();\n if (fontSizeClass) {\n classes.push(fontSizeClass);\n }\n\n const familyClass = this.getFamilyClass();\n if (familyClass) {\n classes.push(familyClass);\n }\n\n if (this.italic) {\n classes.push(TEXT_ITALIC_CLASS);\n }\n\n const alignClass = this.getAlignClass();\n if (alignClass) {\n classes.push(alignClass);\n }\n\n const toneClass = this.getToneClass();\n if (toneClass) {\n classes.push(toneClass);\n }\n\n if (this.truncate) {\n classes.push(TEXT_TRUNCATE_CLASS);\n }\n\n if (this.numeric) {\n classes.push(TEXT_NUMERIC_CLASS);\n }\n\n if (this.maxLines) {\n classes.push(TEXT_LINE_CLAMP_CLASS);\n }\n\n const wrapClass = this.getWrapClass();\n if (wrapClass) {\n classes.push(wrapClass);\n }\n\n const textBoxTrimClass = this.getTextBoxTrimClass();\n if (textBoxTrimClass) {\n classes.push(textBoxTrimClass);\n }\n\n const strengthClass = this.getStrengthClass();\n if (strengthClass) {\n classes.push(strengthClass);\n }\n\n const densityClass = this.getDensityClass();\n if (densityClass) {\n classes.push(densityClass);\n }\n\n return classes;\n },\n\n textStyles() {\n if (!this.maxLines) {\n return undefined;\n }\n\n return {\n '--dt-text-line-clamp': this.maxLines,\n };\n },\n },\n\n mounted() {\n // Emit info once per session when headline is used without semantic heading element\n if (\n !hasEmittedHeadlineSemanticInfo &&\n this.usesHeadlineVisualStyle() &&\n !SEMANTIC_HEADING_ELEMENTS.includes(this.as)\n ) {\n console.info(\n '[DtText] A headline text style is used without a semantic heading element. ' +\n 'Consider using as=\"h1|h2|h3|h4|h5|h6\" for better accessibility.',\n );\n hasEmittedHeadlineSemanticInfo = true;\n }\n },\n\n methods: {\n usesHeadlineVisualStyle() {\n if (this.variant) {\n return this.variant.startsWith('headline-');\n }\n\n return this.kind === 'headline';\n },\n\n usesLegacyKindSize() {\n return Boolean(this.kind && !this.variant);\n },\n\n getVariantClass() {\n if (this.variant) {\n return this.getModifierClass(\n this.variant,\n TEXT_VARIANT_MODIFIERS,\n 'variant',\n );\n }\n\n if (!this.kind) {\n return null;\n }\n\n if (\n !Object.prototype.hasOwnProperty.call(TEXT_KIND_MODIFIERS, this.kind)\n ) {\n console.warn(`[DtText] Unsupported kind \"${this.kind}\".`);\n return null;\n }\n\n const allowedSizes = TEXT_SIZE_MODIFIERS[this.kind] || [];\n const rawSize = this.size != null ? String(this.size) : null;\n const requestedSize = rawSize || DEFAULT_SIZE;\n let resolvedSize = requestedSize;\n\n if (!allowedSizes.includes(requestedSize)) {\n // Headline-only sizes (3xl, 2xl, xl, 500, 600, 700) throw an error when used with incompatible kinds\n if (TEXT_HEADLINE_ONLY_SIZES.includes(requestedSize)) {\n throw new Error(\n `[DtText] size=\"${requestedSize}\" is only valid for kind=\"headline\". ` +\n `Cannot use with kind=\"${this.kind}\".`,\n );\n }\n\n // Universal sizes fall back gracefully with a warning\n const fallbackSize = allowedSizes.includes(DEFAULT_SIZE)\n ? DEFAULT_SIZE\n : allowedSizes[0];\n if (fallbackSize) {\n resolvedSize = fallbackSize;\n }\n console.warn(\n `[DtText] size=\"${requestedSize}\" is not valid for kind=\"${this.kind}\". Using \"${resolvedSize}\" instead.`,\n );\n }\n\n if (!resolvedSize) {\n return null;\n }\n\n // Map numeric sizes to t-shirt CSS class suffix\n const cssSuffix = TEXT_SIZE_MAP[resolvedSize] || resolvedSize;\n return `${TEXT_KIND_MODIFIERS[this.kind]}--${cssSuffix}`;\n },\n\n getFontSizeClass() {\n if (this.size === null || this.size === undefined) {\n return null;\n }\n\n if (!this.variant && !this.kind) {\n console.warn(\n '[DtText] size must be paired with variant or legacy kind. ' +\n 'Prefer variant for typography composition; use size only as a variant override.',\n );\n return null;\n }\n\n if (this.usesLegacyKindSize()) {\n return null;\n }\n\n const size = String(this.size);\n const className = TEXT_FONT_SIZE_MODIFIERS[size];\n if (className) {\n return className;\n }\n\n console.warn(\n `[DtText] Unsupported size \"${size}\". Use a numeric font-size token.`,\n );\n return null;\n },\n\n getModifierClass(value, modifiers, propName) {\n if (value === null || value === undefined) {\n return null;\n }\n\n const className = modifiers[value];\n if (!className) {\n console.warn(`[DtText] Unsupported ${propName} \"${value}\".`);\n return null;\n }\n\n return className;\n },\n\n getAlignClass() {\n return this.getModifierClass(this.align, TEXT_ALIGN_MODIFIERS, 'align');\n },\n\n getToneClass() {\n return this.getModifierClass(this.tone, TEXT_TONE_MODIFIERS, 'tone');\n },\n\n getWrapClass() {\n return this.getModifierClass(this.wrap, TEXT_WRAP_MODIFIERS, 'wrap');\n },\n\n getTextBoxTrimClass() {\n return this.getModifierClass(\n this.textBoxTrim,\n TEXT_BOX_TRIM_MODIFIERS,\n 'textBoxTrim',\n );\n },\n\n getStrengthClass() {\n return this.getModifierClass(\n this.strength,\n TEXT_STRENGTH_MODIFIERS,\n 'strength',\n );\n },\n\n getDensityClass() {\n return this.getModifierClass(\n this.density,\n TEXT_DENSITY_MODIFIERS,\n 'density',\n );\n },\n\n getFamilyClass() {\n return this.getModifierClass(\n this.family,\n TEXT_FAMILY_MODIFIERS,\n 'family',\n );\n },\n },\n};\n</script>\n"],"mappings":"0PAiCA,IAAM,EAAe,MACf,EAA4B,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAK,CAGlE,EAAiC,GAGxB,MAAsC,CACjD,EAAiC,IAO9B,EAAU,CACb,KAAM,SAEN,MAAO,CAKL,GAAI,CACF,KAAM,OACN,QAAS,OACV,CAOD,KAAM,CACJ,KAAM,OACN,QAAS,KACT,UAAY,GAER,IAAU,MACV,OAAO,UAAU,eAAe,KAAK,EAAA,oBAAqB,EAAK,CAGpE,CAMD,QAAS,CACP,KAAM,OACN,QA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AAK,iBAAiB,KAAK,KAAM,EAAA,oBAAqB,OAAO,EAGtE,qBAAsB,CACpB,OAAO,KAAK,iBACV,KAAK,YACL,EAAA,wBACA,cACD,EAGH,kBAAmB,CACjB,OAAO,KAAK,iBACV,KAAK,SACL,EAAA,wBACA,WACD,EAGH,iBAAkB,CAChB,OAAO,KAAK,iBACV,KAAK,QACL,EAAA,uBACA,UACD,EAGH,gBAAiB,CACf,OAAO,KAAK,iBACV,KAAK,OACL,EAAA,sBACA,SACD,EAEJ,CACF,iGAxeQ,EAAA,GAAE,CAAA,CACP,UAAQ,UACP,OAAA,EAAA,EAAA,gBAAO,EAAA,YAAW,CAClB,OAAA,EAAA,EAAA,gBAAO,EAAA,WAAU,6BAGV,EAAA,EAAA,EAAA,YAAA,EAAA,OAAA,UAAA,CAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","names":[],"sources":["../../../components/Text/Text.vue"],"sourcesContent":["<template>\n <component\n :is=\"as\"\n data-qa=\"dt-text\"\n :class=\"textClasses\"\n :style=\"textStyles\"\n >\n <!-- @slot Default slot for text content -->\n <slot />\n </component>\n</template>\n\n<script>\nimport {\n TEXT_KIND_MODIFIERS,\n TEXT_VARIANT_MODIFIERS,\n TEXT_SIZE_MODIFIERS,\n TEXT_SIZE_MAP,\n TEXT_HEADLINE_ONLY_SIZES,\n TEXT_FONT_SIZE_MODIFIERS,\n TEXT_FAMILY_MODIFIERS,\n TEXT_ITALIC_CLASS,\n TEXT_ALIGN_MODIFIERS,\n TEXT_TONE_MODIFIERS,\n TEXT_NUMERIC_CLASS,\n TEXT_TRUNCATE_CLASS,\n TEXT_LINE_CLAMP_CLASS,\n TEXT_WRAP_MODIFIERS,\n TEXT_BOX_TRIM_MODIFIERS,\n TEXT_STRENGTH_MODIFIERS,\n TEXT_DENSITY_MODIFIERS,\n} from './TextConstants';\n\nconst DEFAULT_SIZE = '300';\nconst SEMANTIC_HEADING_ELEMENTS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n// Module-level flag to emit info only once per session\nlet hasEmittedHeadlineSemanticInfo = false;\n\n// Exported for testing purposes only\nexport const resetHeadlineSemanticInfoFlag = () => {\n hasEmittedHeadlineSemanticInfo = false;\n};\n\n/**\n * Dialtone text primitive that applies typography tokens based on semantic props.\n * @see https://dialtone.dialpad.com/components/text.html\n */\nexport default {\n name: 'DtText',\n\n props: {\n /**\n * HTML tag or component used for rendering.\n * @values span, p, strong, h1, h2, h3, h4, h5, h6, label, div, component\n */\n as: {\n type: String,\n default: 'span',\n },\n\n /**\n * Typography kind mapping to headline/body/label/code token sets.\n * @values headline, body, label, code\n * @deprecated Use variant instead\n */\n kind: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_KIND_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Typography variant mapping to a complete token-backed composition.\n * @values headline-3xl, headline-2xl, headline-xl, headline-lg, headline-md, headline-sm, headline-xs, body-lg, body-md, body-sm, body-xs, label-lg, label-md, label-sm, label-xs, code-lg, code-md, code-sm, code-xs\n */\n variant: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_VARIANT_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Raw font-size token. Must be paired with `variant` for overrides or legacy `kind` for composition size.\n * @values 50, 75, 100, 125, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800\n */\n size: {\n type: [String, Number],\n default: null,\n },\n\n /**\n * Overrides font-family. By default, no font-family class is emitted and text inherits naturally.\n * @values inherit, custom, sans, mono, expressive\n */\n family: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_FAMILY_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Applies italic font style when true.\n */\n italic: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Semantic foreground color.\n * @values primary, secondary, tertiary, muted, disabled, placeholder, critical, critical-strong, positive, positive-strong, warning, info, info-strong, neutral-black, neutral-white\n */\n tone: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_TONE_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Logical text alignment. Requires block/inline-block context.\n * @values start, center, end, justify\n */\n align: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_ALIGN_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Enables single-line truncation (i.e. ellipsis) when true; requires block/inline-block context.\n */\n truncate: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Applies multi-line truncation (i.e. clamp) when greater than zero; requires block/inline-block context.\n */\n maxLines: {\n type: Number,\n default: null,\n validator: (value) => {\n return value === null || (Number.isInteger(value) && value > 0);\n },\n },\n\n /**\n * Renders numeric content with tabular figures.\n */\n numeric: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls text wrapping behavior.\n * @values wrap, nowrap, balance, pretty\n */\n wrap: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_WRAP_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Controls text-box-trim (leading space above/below text). Useful for tight component layouts.\n * @values start, end, both\n */\n textBoxTrim: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_BOX_TRIM_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Overrides font-weight. Applies to any kind/size combination.\n * @values bold, semibold, medium, normal\n */\n strength: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_STRENGTH_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Overrides line-height. Applies to any kind/size combination.\n * @values 100, 200, 300, 400, 500, 600\n */\n density: {\n type: [String, Number],\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_DENSITY_MODIFIERS, value)\n );\n },\n },\n },\n\n computed: {\n textClasses() {\n const classes = ['d-text'];\n const variantClass = this.getVariantClass();\n if (variantClass) {\n classes.push(variantClass);\n }\n\n const fontSizeClass = this.getFontSizeClass();\n if (fontSizeClass) {\n classes.push(fontSizeClass);\n }\n\n const familyClass = this.getFamilyClass();\n if (familyClass) {\n classes.push(familyClass);\n }\n\n if (this.italic) {\n classes.push(TEXT_ITALIC_CLASS);\n }\n\n const alignClass = this.getAlignClass();\n if (alignClass) {\n classes.push(alignClass);\n }\n\n const toneClass = this.getToneClass();\n if (toneClass) {\n classes.push(toneClass);\n }\n\n if (this.truncate) {\n classes.push(TEXT_TRUNCATE_CLASS);\n }\n\n if (this.numeric) {\n classes.push(TEXT_NUMERIC_CLASS);\n }\n\n if (this.maxLines) {\n classes.push(TEXT_LINE_CLAMP_CLASS);\n }\n\n const wrapClass = this.getWrapClass();\n if (wrapClass) {\n classes.push(wrapClass);\n }\n\n const textBoxTrimClass = this.getTextBoxTrimClass();\n if (textBoxTrimClass) {\n classes.push(textBoxTrimClass);\n }\n\n const strengthClass = this.getStrengthClass();\n if (strengthClass) {\n classes.push(strengthClass);\n }\n\n const densityClass = this.getDensityClass();\n if (densityClass) {\n classes.push(densityClass);\n }\n\n return classes;\n },\n\n textStyles() {\n if (!this.maxLines) {\n return undefined;\n }\n\n return {\n '--dt-text-line-clamp': this.maxLines,\n };\n },\n },\n\n mounted() {\n // Emit info once per session when headline is used without semantic heading element\n if (\n !hasEmittedHeadlineSemanticInfo &&\n this.usesHeadlineVisualStyle() &&\n !SEMANTIC_HEADING_ELEMENTS.includes(this.as)\n ) {\n console.info(\n '[DtText] A headline text style is used without a semantic heading element. ' +\n 'Consider using as=\"h1|h2|h3|h4|h5|h6\" for better accessibility.',\n );\n hasEmittedHeadlineSemanticInfo = true;\n }\n },\n\n methods: {\n usesHeadlineVisualStyle() {\n if (this.variant) {\n return this.variant.startsWith('headline-');\n }\n\n return this.kind === 'headline';\n },\n\n usesLegacyKindSize() {\n return Boolean(this.kind && !this.variant);\n },\n\n getVariantClass() {\n if (this.variant) {\n return this.getModifierClass(\n this.variant,\n TEXT_VARIANT_MODIFIERS,\n 'variant',\n );\n }\n\n if (!this.kind) {\n return null;\n }\n\n if (\n !Object.prototype.hasOwnProperty.call(TEXT_KIND_MODIFIERS, this.kind)\n ) {\n console.warn(`[DtText] Unsupported kind \"${this.kind}\".`);\n return null;\n }\n\n const allowedSizes = TEXT_SIZE_MODIFIERS[this.kind] || [];\n const rawSize = this.size != null ? String(this.size) : null;\n const requestedSize = rawSize || DEFAULT_SIZE;\n let resolvedSize = requestedSize;\n\n if (!allowedSizes.includes(requestedSize)) {\n // Headline-only sizes (3xl, 2xl, xl, 500, 600, 700) throw an error when used with incompatible kinds\n if (TEXT_HEADLINE_ONLY_SIZES.includes(requestedSize)) {\n throw new Error(\n `[DtText] size=\"${requestedSize}\" is only valid for kind=\"headline\". ` +\n `Cannot use with kind=\"${this.kind}\".`,\n );\n }\n\n // Universal sizes fall back gracefully with a warning\n const fallbackSize = allowedSizes.includes(DEFAULT_SIZE)\n ? DEFAULT_SIZE\n : allowedSizes[0];\n if (fallbackSize) {\n resolvedSize = fallbackSize;\n }\n console.warn(\n `[DtText] size=\"${requestedSize}\" is not valid for kind=\"${this.kind}\". Using \"${resolvedSize}\" instead.`,\n );\n }\n\n if (!resolvedSize) {\n return null;\n }\n\n // Map numeric sizes to t-shirt CSS class suffix\n const cssSuffix = TEXT_SIZE_MAP[resolvedSize] || resolvedSize;\n return `${TEXT_KIND_MODIFIERS[this.kind]}--${cssSuffix}`;\n },\n\n getFontSizeClass() {\n if (this.size === null || this.size === undefined) {\n return null;\n }\n\n if (!this.variant && !this.kind) {\n console.warn(\n '[DtText] size must be paired with variant or legacy kind. ' +\n 'Prefer variant for typography composition; use size only as a variant override.',\n );\n return null;\n }\n\n if (this.usesLegacyKindSize()) {\n return null;\n }\n\n const size = String(this.size);\n const className = TEXT_FONT_SIZE_MODIFIERS[size];\n if (className) {\n return className;\n }\n\n console.warn(\n `[DtText] Unsupported size \"${size}\". Use a numeric font-size token.`,\n );\n return null;\n },\n\n getModifierClass(value, modifiers, propName) {\n if (value === null || value === undefined) {\n return null;\n }\n\n const className = modifiers[value];\n if (!className) {\n console.warn(`[DtText] Unsupported ${propName} \"${value}\".`);\n return null;\n }\n\n return className;\n },\n\n getAlignClass() {\n return this.getModifierClass(this.align, TEXT_ALIGN_MODIFIERS, 'align');\n },\n\n getToneClass() {\n return this.getModifierClass(this.tone, TEXT_TONE_MODIFIERS, 'tone');\n },\n\n getWrapClass() {\n return this.getModifierClass(this.wrap, TEXT_WRAP_MODIFIERS, 'wrap');\n },\n\n getTextBoxTrimClass() {\n return this.getModifierClass(\n this.textBoxTrim,\n TEXT_BOX_TRIM_MODIFIERS,\n 'textBoxTrim',\n );\n },\n\n getStrengthClass() {\n return this.getModifierClass(\n this.strength,\n TEXT_STRENGTH_MODIFIERS,\n 'strength',\n );\n },\n\n getDensityClass() {\n return this.getModifierClass(\n this.density,\n TEXT_DENSITY_MODIFIERS,\n 'density',\n );\n },\n\n getFamilyClass() {\n return this.getModifierClass(\n this.family,\n TEXT_FAMILY_MODIFIERS,\n 'family',\n );\n },\n },\n};\n</script>\n"],"mappings":";;;;AAiCA,IAAM,IAAe,OACf,IAA4B;CAAC;CAAM;CAAM;CAAM;CAAM;CAAM;CAAK,EAGlE,IAAiC,IAGxB,UAAsC;AACjD,KAAiC;GAO9B,IAAU;CACb,MAAM;CAEN,OAAO;EAKL,IAAI;GACF,MAAM;GACN,SAAS;GACV;EAOD,MAAM;GACJ,MAAM;GACN,SAAS;GACT,YAAY,MAER,MAAU,QACV,OAAO,UAAU,eAAe,KAAK,GAAqB,EAAK;GAGpE;EAMD,SAAS;GACP,MAAM;GACN,SAAS;GACT,YAAY,MAER,MAAU,QACV,OAAO,UAAU,eAAe,KAAK,GAAwB,EAAK;GAGvE;EAMD,MA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