@mattermost/compass-ui 0.1.0-alpha.6 → 0.1.0-alpha.7
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/components/action-button/ActionButton.cjs.map +1 -1
- package/dist/components/action-button/ActionButton.d.ts +1 -0
- package/dist/components/action-button/ActionButton.d.ts.map +1 -1
- package/dist/components/action-button/ActionButton.js.map +1 -1
- package/dist/components/admin-panel/AdminPanel.cjs.map +1 -1
- package/dist/components/admin-panel/AdminPanel.d.ts +1 -0
- package/dist/components/admin-panel/AdminPanel.d.ts.map +1 -1
- package/dist/components/admin-panel/AdminPanel.js.map +1 -1
- package/dist/components/admin-panel-header/AdminPanelHeader.cjs.map +1 -1
- package/dist/components/admin-panel-header/AdminPanelHeader.d.ts +1 -0
- package/dist/components/admin-panel-header/AdminPanelHeader.d.ts.map +1 -1
- package/dist/components/admin-panel-header/AdminPanelHeader.js.map +1 -1
- package/dist/components/button/Button.cjs +1 -1
- package/dist/components/button/Button.cjs.map +1 -1
- package/dist/components/button/Button.d.ts +2 -2
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +24 -24
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/Button.module.css +1 -1
- package/dist/components/button/Button.module.scss.cjs +1 -1
- package/dist/components/button/Button.module.scss.js +13 -12
- package/dist/components/button/Button.module.scss.js.map +1 -1
- package/dist/components/card-button/CardButton.cjs +2 -0
- package/dist/components/card-button/CardButton.cjs.map +1 -0
- package/dist/components/card-button/CardButton.d.ts +20 -0
- package/dist/components/card-button/CardButton.d.ts.map +1 -0
- package/dist/components/card-button/CardButton.js +45 -0
- package/dist/components/card-button/CardButton.js.map +1 -0
- package/dist/components/card-button/CardButton.module.css +1 -0
- package/dist/components/card-button/CardButton.module.scss.cjs +2 -0
- package/dist/components/card-button/CardButton.module.scss.cjs.map +1 -0
- package/dist/components/card-button/CardButton.module.scss.js +13 -0
- package/dist/components/card-button/CardButton.module.scss.js.map +1 -0
- package/dist/components/card-button/CardButtonGroup.cjs +2 -0
- package/dist/components/card-button/CardButtonGroup.cjs.map +1 -0
- package/dist/components/card-button/CardButtonGroup.d.ts +13 -0
- package/dist/components/card-button/CardButtonGroup.d.ts.map +1 -0
- package/dist/components/card-button/CardButtonGroup.js +85 -0
- package/dist/components/card-button/CardButtonGroup.js.map +1 -0
- package/dist/components/card-button/CardButtonGroup.module.css +1 -0
- package/dist/components/card-button/CardButtonGroup.module.scss.cjs +2 -0
- package/dist/components/card-button/CardButtonGroup.module.scss.cjs.map +1 -0
- package/dist/components/card-button/CardButtonGroup.module.scss.js +7 -0
- package/dist/components/card-button/CardButtonGroup.module.scss.js.map +1 -0
- package/dist/components/card-button/index.cjs +2 -0
- package/dist/components/card-button/index.d.ts +5 -0
- package/dist/components/card-button/index.d.ts.map +1 -0
- package/dist/components/card-button/index.js +7 -0
- package/dist/components/card-button/index.js.map +1 -0
- package/dist/components/emoji-button/EmojiButton.cjs +2 -0
- package/dist/components/emoji-button/EmojiButton.cjs.map +1 -0
- package/dist/components/emoji-button/EmojiButton.d.ts +30 -0
- package/dist/components/emoji-button/EmojiButton.d.ts.map +1 -0
- package/dist/components/emoji-button/EmojiButton.js +35 -0
- package/dist/components/emoji-button/EmojiButton.js.map +1 -0
- package/dist/components/emoji-button/EmojiButton.module.css +1 -0
- package/dist/components/emoji-button/EmojiButton.module.scss.cjs +2 -0
- package/dist/components/emoji-button/EmojiButton.module.scss.cjs.map +1 -0
- package/dist/components/emoji-button/EmojiButton.module.scss.js +15 -0
- package/dist/components/emoji-button/EmojiButton.module.scss.js.map +1 -0
- package/dist/components/emoji-button/index.cjs +2 -0
- package/dist/components/emoji-button/index.cjs.map +1 -0
- package/dist/components/emoji-button/index.d.ts +3 -0
- package/dist/components/emoji-button/index.d.ts.map +1 -0
- package/dist/components/emoji-button/index.js +6 -0
- package/dist/components/emoji-popover/EmojiPopover.cjs +2 -0
- package/dist/components/emoji-popover/EmojiPopover.cjs.map +1 -0
- package/dist/components/emoji-popover/EmojiPopover.d.ts +34 -0
- package/dist/components/emoji-popover/EmojiPopover.d.ts.map +1 -0
- package/dist/components/emoji-popover/EmojiPopover.js +244 -0
- package/dist/components/emoji-popover/EmojiPopover.js.map +1 -0
- package/dist/components/emoji-popover/EmojiPopover.module.css +1 -0
- package/dist/components/emoji-popover/EmojiPopover.module.scss.cjs +2 -0
- package/dist/components/emoji-popover/EmojiPopover.module.scss.cjs.map +1 -0
- package/dist/components/emoji-popover/EmojiPopover.module.scss.js +27 -0
- package/dist/components/emoji-popover/EmojiPopover.module.scss.js.map +1 -0
- package/dist/components/{message-reactions → emoji-popover}/index.cjs +1 -1
- package/dist/components/emoji-popover/index.cjs.map +1 -0
- package/dist/components/emoji-popover/index.d.ts +3 -0
- package/dist/components/emoji-popover/index.d.ts.map +1 -0
- package/dist/components/emoji-popover/index.js +5 -0
- package/dist/components/emoji-popover/index.js.map +1 -0
- package/dist/components/global-banner/GlobalBanner.cjs.map +1 -1
- package/dist/components/global-banner/GlobalBanner.d.ts +1 -1
- package/dist/components/global-banner/GlobalBanner.d.ts.map +1 -1
- package/dist/components/global-banner/GlobalBanner.js.map +1 -1
- package/dist/components/global-header/GlobalHeader.module.css +1 -1
- package/dist/components/global-header/GlobalHeader.module.scss.cjs +1 -1
- package/dist/components/global-header/GlobalHeader.module.scss.js +16 -16
- package/dist/components/menu-group-heading/MenuGroupHeading.cjs +2 -0
- package/dist/components/menu-group-heading/MenuGroupHeading.cjs.map +1 -0
- package/dist/components/menu-group-heading/MenuGroupHeading.d.ts +11 -0
- package/dist/components/menu-group-heading/MenuGroupHeading.d.ts.map +1 -0
- package/dist/components/menu-group-heading/MenuGroupHeading.js +20 -0
- package/dist/components/menu-group-heading/MenuGroupHeading.js.map +1 -0
- package/dist/components/menu-group-heading/MenuGroupHeading.module.css +1 -0
- package/dist/components/menu-group-heading/MenuGroupHeading.module.scss.cjs +2 -0
- package/dist/components/menu-group-heading/MenuGroupHeading.module.scss.cjs.map +1 -0
- package/dist/components/menu-group-heading/MenuGroupHeading.module.scss.js +8 -0
- package/dist/components/menu-group-heading/MenuGroupHeading.module.scss.js.map +1 -0
- package/dist/components/menu-group-heading/index.cjs +2 -0
- package/dist/components/menu-group-heading/index.cjs.map +1 -0
- package/dist/components/menu-group-heading/index.d.ts +3 -0
- package/dist/components/menu-group-heading/index.d.ts.map +1 -0
- package/dist/components/menu-group-heading/index.js +5 -0
- package/dist/components/menu-group-heading/index.js.map +1 -0
- package/dist/components/menu-item/MenuItem.cjs.map +1 -1
- package/dist/components/menu-item/MenuItem.d.ts +2 -2
- package/dist/components/menu-item/MenuItem.d.ts.map +1 -1
- package/dist/components/menu-item/MenuItem.js.map +1 -1
- package/dist/components/message-separator/MessageSeparator.cjs +1 -1
- package/dist/components/message-separator/MessageSeparator.cjs.map +1 -1
- package/dist/components/message-separator/MessageSeparator.d.ts +1 -1
- package/dist/components/message-separator/MessageSeparator.js +1 -1
- package/dist/components/message-separator/MessageSeparator.js.map +1 -1
- package/dist/components/modal/Modal.cjs +1 -1
- package/dist/components/modal/Modal.cjs.map +1 -1
- package/dist/components/modal/Modal.d.ts +43 -11
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +56 -74
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/Modal.module.css +1 -1
- package/dist/components/modal/Modal.module.scss.cjs +1 -1
- package/dist/components/modal/Modal.module.scss.js +12 -25
- package/dist/components/modal/Modal.module.scss.js.map +1 -1
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/modal-footer/ModalFooter.cjs +2 -0
- package/dist/components/modal-footer/ModalFooter.cjs.map +1 -0
- package/dist/components/modal-footer/ModalFooter.d.ts +29 -0
- package/dist/components/modal-footer/ModalFooter.d.ts.map +1 -0
- package/dist/components/modal-footer/ModalFooter.js +31 -0
- package/dist/components/modal-footer/ModalFooter.js.map +1 -0
- package/dist/components/modal-footer/ModalFooter.module.css +1 -0
- package/dist/components/modal-footer/ModalFooter.module.scss.cjs +2 -0
- package/dist/components/modal-footer/ModalFooter.module.scss.cjs.map +1 -0
- package/dist/components/modal-footer/ModalFooter.module.scss.js +17 -0
- package/dist/components/modal-footer/ModalFooter.module.scss.js.map +1 -0
- package/dist/components/modal-footer/index.cjs +2 -0
- package/dist/components/modal-footer/index.cjs.map +1 -0
- package/dist/components/modal-footer/index.d.ts +3 -0
- package/dist/components/modal-footer/index.d.ts.map +1 -0
- package/dist/components/modal-footer/index.js +5 -0
- package/dist/components/modal-footer/index.js.map +1 -0
- package/dist/components/modal-header/ModalHeader.cjs +2 -0
- package/dist/components/modal-header/ModalHeader.cjs.map +1 -0
- package/dist/components/modal-header/ModalHeader.d.ts +38 -0
- package/dist/components/modal-header/ModalHeader.d.ts.map +1 -0
- package/dist/components/modal-header/ModalHeader.js +74 -0
- package/dist/components/modal-header/ModalHeader.js.map +1 -0
- package/dist/components/modal-header/ModalHeader.module.css +1 -0
- package/dist/components/modal-header/ModalHeader.module.scss.cjs +2 -0
- package/dist/components/modal-header/ModalHeader.module.scss.cjs.map +1 -0
- package/dist/components/modal-header/ModalHeader.module.scss.js +19 -0
- package/dist/components/modal-header/ModalHeader.module.scss.js.map +1 -0
- package/dist/components/modal-header/index.cjs +2 -0
- package/dist/components/modal-header/index.cjs.map +1 -0
- package/dist/components/modal-header/index.d.ts +3 -0
- package/dist/components/modal-header/index.d.ts.map +1 -0
- package/dist/components/modal-header/index.js +5 -0
- package/dist/components/modal-header/index.js.map +1 -0
- package/dist/components/popover-notice/PopoverNotice.cjs.map +1 -1
- package/dist/components/popover-notice/PopoverNotice.d.ts +1 -1
- package/dist/components/popover-notice/PopoverNotice.d.ts.map +1 -1
- package/dist/components/popover-notice/PopoverNotice.js.map +1 -1
- package/dist/components/reaction-button/ReactionButton.cjs +2 -0
- package/dist/components/reaction-button/ReactionButton.cjs.map +1 -0
- package/dist/components/reaction-button/ReactionButton.d.ts +17 -0
- package/dist/components/reaction-button/ReactionButton.d.ts.map +1 -0
- package/dist/components/reaction-button/ReactionButton.js +42 -0
- package/dist/components/reaction-button/ReactionButton.js.map +1 -0
- package/dist/components/reaction-button/ReactionButton.module.css +1 -0
- package/dist/components/reaction-button/ReactionButton.module.scss.cjs +2 -0
- package/dist/components/reaction-button/ReactionButton.module.scss.cjs.map +1 -0
- package/dist/components/reaction-button/ReactionButton.module.scss.js +12 -0
- package/dist/components/reaction-button/ReactionButton.module.scss.js.map +1 -0
- package/dist/components/reaction-button/index.cjs +2 -0
- package/dist/components/reaction-button/index.cjs.map +1 -0
- package/dist/components/reaction-button/index.d.ts +3 -0
- package/dist/components/reaction-button/index.d.ts.map +1 -0
- package/dist/components/reaction-button/index.js +5 -0
- package/dist/components/reaction-button/index.js.map +1 -0
- package/dist/components/reactions-row/ReactionsRow.cjs +2 -0
- package/dist/components/reactions-row/ReactionsRow.cjs.map +1 -0
- package/dist/components/{message-reactions/MessageReactions.d.ts → reactions-row/ReactionsRow.d.ts} +5 -5
- package/dist/components/reactions-row/ReactionsRow.d.ts.map +1 -0
- package/dist/components/reactions-row/ReactionsRow.js +71 -0
- package/dist/components/reactions-row/ReactionsRow.js.map +1 -0
- package/dist/components/reactions-row/ReactionsRow.module.css +1 -0
- package/dist/components/reactions-row/ReactionsRow.module.scss.cjs +2 -0
- package/dist/components/reactions-row/ReactionsRow.module.scss.cjs.map +1 -0
- package/dist/components/reactions-row/ReactionsRow.module.scss.js +14 -0
- package/dist/components/reactions-row/ReactionsRow.module.scss.js.map +1 -0
- package/dist/components/reactions-row/index.cjs +2 -0
- package/dist/components/reactions-row/index.cjs.map +1 -0
- package/dist/components/reactions-row/index.d.ts +3 -0
- package/dist/components/reactions-row/index.d.ts.map +1 -0
- package/dist/components/reactions-row/index.js +5 -0
- package/dist/components/reactions-row/index.js.map +1 -0
- package/dist/components/right-sidebar-header/RightSidebarHeader.cjs.map +1 -1
- package/dist/components/right-sidebar-header/RightSidebarHeader.d.ts +1 -1
- package/dist/components/right-sidebar-header/RightSidebarHeader.d.ts.map +1 -1
- package/dist/components/right-sidebar-header/RightSidebarHeader.js.map +1 -1
- package/dist/components/section-notice/SectionNotice.cjs.map +1 -1
- package/dist/components/section-notice/SectionNotice.d.ts +1 -1
- package/dist/components/section-notice/SectionNotice.d.ts.map +1 -1
- package/dist/components/section-notice/SectionNotice.js.map +1 -1
- package/dist/components/tag/Tag.cjs.map +1 -1
- package/dist/components/tag/Tag.d.ts +1 -1
- package/dist/components/tag/Tag.d.ts.map +1 -1
- package/dist/components/tag/Tag.js.map +1 -1
- package/dist/components/text-input/TextInput.cjs.map +1 -1
- package/dist/components/text-input/TextInput.d.ts +1 -1
- package/dist/components/text-input/TextInput.d.ts.map +1 -1
- package/dist/components/text-input/TextInput.js.map +1 -1
- package/dist/components/thread-footer/ThreadFooter.module.css +1 -1
- package/dist/components/thread-footer/ThreadFooter.module.scss.cjs +1 -1
- package/dist/components/thread-footer/ThreadFooter.module.scss.js +19 -19
- package/dist/components/tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/tour-point/TourPoint.module.css +1 -1
- package/dist/components/tour-point/TourPoint.module.scss.cjs +1 -1
- package/dist/components/tour-point/TourPoint.module.scss.js +28 -28
- package/dist/index.cjs +1 -1
- package/dist/index.css +23 -7
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +192 -175
- package/dist/index.js.map +1 -1
- package/package.json +25 -4
- package/dist/components/message-reactions/MessageReactions.cjs +0 -2
- package/dist/components/message-reactions/MessageReactions.cjs.map +0 -1
- package/dist/components/message-reactions/MessageReactions.d.ts.map +0 -1
- package/dist/components/message-reactions/MessageReactions.js +0 -85
- package/dist/components/message-reactions/MessageReactions.js.map +0 -1
- package/dist/components/message-reactions/MessageReactions.module.css +0 -1
- package/dist/components/message-reactions/MessageReactions.module.scss.cjs +0 -2
- package/dist/components/message-reactions/MessageReactions.module.scss.cjs.map +0 -1
- package/dist/components/message-reactions/MessageReactions.module.scss.js +0 -18
- package/dist/components/message-reactions/MessageReactions.module.scss.js.map +0 -1
- package/dist/components/message-reactions/index.d.ts +0 -3
- package/dist/components/message-reactions/index.d.ts.map +0 -1
- package/dist/components/message-reactions/index.js +0 -5
- /package/dist/components/{message-reactions → card-button}/index.cjs.map +0 -0
- /package/dist/components/{message-reactions → emoji-button}/index.js.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.cjs","sources":["../../../src/components/menu-item/MenuItem.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes, ReactNode } from 'react';\nimport EmoticonHappyOutlineIcon from '@mattermost/compass-icons/components/emoticon-happy-outline';\nimport CheckIcon from '@mattermost/compass-icons/components/check';\nimport Icon from '@/components/icon/Icon';\nimport Tag from '@/components/tag/Tag';\nimport MentionBadge from '@/components/mention-badge/MentionBadge';\nimport styles from './MenuItem.module.scss';\n\nexport interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Primary label text. */\n label: string;\n /** Optional secondary label. */\n secondaryLabel?: ReactNode;\n /** Where the secondary label appears. Default: 'below'. */\n secondaryLabelPosition?: 'inline' | 'below';\n /** Custom content for the leading slot. When omitted, shows placeholder icon. */\n leadingVisual?: ReactNode;\n /** Show the leading visual slot. Default: true. */\n leadingElement?: boolean;\n /** Custom content for the trailing slot. When omitted with trailingElement=true, shows check icon. */\n trailingVisual?: ReactNode;\n /** Show the trailing visual slot. Default: false. */\n trailingElement?: boolean;\n /** Emoji character for custom status, shown inline after the label. */\n customStatusEmoji?: string;\n /** Show \"NEW\" label tag. */\n tag?: boolean;\n /** Inline mention count badge. */\n mentionCount?: number;\n /** Destructive (danger) styling. */\n destructive?: boolean;\n /** Highlight row (e.g. submenu parent while child menu is open). */\n active?: boolean;\n}\n\n/**\n * Menu Items are the rows inside a Menu — the smallest selectable unit in any dropdown,\n * kebab, or context menu. One label, optional supporting visuals, and a clear hit target.\n */\nexport default function MenuItem({\n label,\n secondaryLabel,\n secondaryLabelPosition = 'below',\n leadingVisual,\n leadingElement = true,\n trailingVisual,\n trailingElement = false,\n customStatusEmoji,\n tag = false,\n mentionCount,\n destructive = false,\n active = false,\n className = '',\n disabled,\n type = 'button',\n ...rest\n}: MenuItemProps) {\n const rootClass = [\n styles['menu-item'],\n destructive ? styles['menu-item--destructive'] : '',\n active ? styles['menu-item--active'] : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <button className={rootClass} type={type} disabled={disabled} {...rest}>\n <div className={styles['menu-item__content']}>\n {leadingElement && (\n <div className={styles['menu-item__left']}>\n <span className={styles['menu-item__leading-visual']} aria-hidden>\n {leadingVisual ?? (\n <Icon glyph={<EmoticonHappyOutlineIcon />} size=\"16\" />\n )}\n </span>\n </div>\n )}\n <div className={styles['menu-item__middle']}>\n <div className={styles['menu-item__top-row']}>\n <span className={styles['menu-item__label']}>{label}</span>\n {secondaryLabel && secondaryLabelPosition === 'inline' && (\n <span className={styles['menu-item__secondary-label-inline']}>\n {secondaryLabel}\n </span>\n )}\n {customStatusEmoji && (\n <span className={styles['menu-item__custom-status']} aria-hidden>\n {customStatusEmoji}\n </span>\n )}\n {tag && <Tag label=\"NEW\" />}\n {mentionCount != null && mentionCount > 0 && (\n <MentionBadge\n count={mentionCount}\n location=\"menu-item\"\n size=\"small\"\n />\n )}\n </div>\n {secondaryLabel && secondaryLabelPosition === 'below' && (\n <div className={styles['menu-item__bottom-row']}>\n <span className={styles['menu-item__secondary-label-below']}>\n {secondaryLabel}\n </span>\n </div>\n )}\n </div>\n {trailingElement && (\n <div className={styles['menu-item__right']}>\n <span\n className={[\n styles['menu-item__trailing-visual'],\n !trailingVisual\n ? styles['menu-item__trailing-visual--check']\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {trailingVisual ?? <Icon glyph={<CheckIcon />} size=\"16\" />}\n </span>\n </div>\n )}\n </div>\n </button>\n );\n}\n"],"names":["MenuItem","label","secondaryLabel","secondaryLabelPosition","leadingVisual","leadingElement","trailingVisual","trailingElement","customStatusEmoji","tag","mentionCount","destructive","active","className","disabled","type","rest","rootClass","styles","jsx","jsxs","Icon","EmoticonHappyOutlineIcon","Tag","MentionBadge","CheckIcon"],"mappings":"kaAuCA,SAAwBA,EAAS,CAC/B,MAAAC,EACA,eAAAC,EACA,uBAAAC,EAAyB,QACzB,cAAAC,EACA,eAAAC,EAAiB,GACjB,eAAAC,EACA,gBAAAC,EAAkB,GAClB,kBAAAC,EACA,IAAAC,EAAM,GACN,aAAAC,EACA,YAAAC,EAAc,GACd,OAAAC,EAAS,GACT,UAAAC,EAAY,GACZ,SAAAC,EACA,KAAAC,EAAO,SACP,GAAGC,CACL,EAAkB,CAChB,MAAMC,EAAY,CAChBC,EAAAA,QAAO,WAAW,EAClBP,EAAcO,EAAAA,QAAO,wBAAwB,EAAI,GACjDN,EAASM,EAAAA,QAAO,mBAAmB,EAAI,GACvCL,CAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,EAEX,OACEM,EAAAA,IAAC,SAAA,CAAO,UAAWF,EAAW,KAAAF,EAAY,SAAAD,EAAqB,GAAGE,EAChE,SAAAI,EAAAA,KAAC,MAAA,CAAI,UAAWF,EAAAA,QAAO,oBAAoB,EACxC,SAAA,CAAAb,GACCc,EAAAA,IAAC,MAAA,CAAI,UAAWD,EAAAA,QAAO,iBAAiB,EACtC,SAAAC,EAAAA,IAAC,OAAA,CAAK,UAAWD,EAAAA,QAAO,2BAA2B,EAAG,cAAW,GAC9D,SAAAd,GACCe,EAAAA,IAACE,EAAAA,QAAA,CAAK,MAAOF,EAAAA,IAACG,IAAyB,EAAI,KAAK,IAAA,CAAK,CAAA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"],"sourcesContent":["import type { ButtonHTMLAttributes, ReactNode } from 'react';\nimport EmoticonHappyOutlineIcon from '@mattermost/compass-icons/components/emoticon-happy-outline';\nimport CheckIcon from '@mattermost/compass-icons/components/check';\nimport Icon from '@/components/icon/Icon';\nimport Tag from '@/components/tag/Tag';\nimport MentionBadge from '@/components/mention-badge/MentionBadge';\nimport styles from './MenuItem.module.scss';\n\nexport interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Primary label text. */\n label: string;\n /** Optional secondary label. */\n secondaryLabel?: ReactNode;\n /** Where the secondary label appears. Default: 'below'. */\n secondaryLabelPosition?: 'inline' | 'below';\n /** Custom content for the leading slot. When omitted, shows placeholder icon. When passing an icon, use `<Icon glyph={<SomeIcon />} size=\"16\" />`. */\n leadingVisual?: ReactNode;\n /** Show the leading visual slot. Default: true. */\n leadingElement?: boolean;\n /** Custom content for the trailing slot. When omitted with trailingElement=true, shows check icon. When passing an icon, use `<Icon glyph={<SomeIcon />} size=\"16\" />`. */\n trailingVisual?: ReactNode;\n /** Show the trailing visual slot. Default: false. */\n trailingElement?: boolean;\n /** Emoji character for custom status, shown inline after the label. */\n customStatusEmoji?: string;\n /** Show \"NEW\" label tag. */\n tag?: boolean;\n /** Inline mention count badge. */\n mentionCount?: number;\n /** Destructive (danger) styling. */\n destructive?: boolean;\n /** Highlight row (e.g. submenu parent while child menu is open). */\n active?: boolean;\n}\n\n/**\n * Menu Items are the rows inside a Menu — the smallest selectable unit in any dropdown,\n * kebab, or context menu. One label, optional supporting visuals, and a clear hit target.\n */\nexport default function MenuItem({\n label,\n secondaryLabel,\n secondaryLabelPosition = 'below',\n leadingVisual,\n leadingElement = true,\n trailingVisual,\n trailingElement = false,\n customStatusEmoji,\n tag = false,\n mentionCount,\n destructive = false,\n active = false,\n className = '',\n disabled,\n type = 'button',\n ...rest\n}: MenuItemProps) {\n const rootClass = [\n styles['menu-item'],\n destructive ? styles['menu-item--destructive'] : '',\n active ? styles['menu-item--active'] : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <button className={rootClass} type={type} disabled={disabled} {...rest}>\n <div className={styles['menu-item__content']}>\n {leadingElement && (\n <div className={styles['menu-item__left']}>\n <span className={styles['menu-item__leading-visual']} aria-hidden>\n {leadingVisual ?? (\n <Icon glyph={<EmoticonHappyOutlineIcon />} size=\"16\" />\n )}\n </span>\n </div>\n )}\n <div className={styles['menu-item__middle']}>\n <div className={styles['menu-item__top-row']}>\n <span className={styles['menu-item__label']}>{label}</span>\n {secondaryLabel && secondaryLabelPosition === 'inline' && (\n <span className={styles['menu-item__secondary-label-inline']}>\n {secondaryLabel}\n </span>\n )}\n {customStatusEmoji && (\n <span className={styles['menu-item__custom-status']} aria-hidden>\n {customStatusEmoji}\n </span>\n )}\n {tag && <Tag label=\"NEW\" />}\n {mentionCount != null && mentionCount > 0 && (\n <MentionBadge\n count={mentionCount}\n location=\"menu-item\"\n size=\"small\"\n />\n )}\n </div>\n {secondaryLabel && secondaryLabelPosition === 'below' && (\n <div className={styles['menu-item__bottom-row']}>\n <span className={styles['menu-item__secondary-label-below']}>\n {secondaryLabel}\n </span>\n </div>\n )}\n </div>\n {trailingElement && (\n <div className={styles['menu-item__right']}>\n <span\n className={[\n styles['menu-item__trailing-visual'],\n !trailingVisual\n ? styles['menu-item__trailing-visual--check']\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {trailingVisual ?? <Icon glyph={<CheckIcon />} size=\"16\" />}\n </span>\n </div>\n )}\n </div>\n </button>\n );\n}\n"],"names":["MenuItem","label","secondaryLabel","secondaryLabelPosition","leadingVisual","leadingElement","trailingVisual","trailingElement","customStatusEmoji","tag","mentionCount","destructive","active","className","disabled","type","rest","rootClass","styles","jsx","jsxs","Icon","EmoticonHappyOutlineIcon","Tag","MentionBadge","CheckIcon"],"mappings":"kaAuCA,SAAwBA,EAAS,CAC/B,MAAAC,EACA,eAAAC,EACA,uBAAAC,EAAyB,QACzB,cAAAC,EACA,eAAAC,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EDC,GAAOU,EAAAA,IAACI,EAAAA,QAAA,CAAI,MAAM,KAAA,CAAM,EACxBb,GAAgB,MAAQA,EAAe,GACtCS,EAAAA,IAACK,EAAAA,QAAA,CACC,MAAOd,EACP,SAAS,YACT,KAAK,OAAA,CAAA,CACP,EAEJ,EACCR,GAAkBC,IAA2B,SAC5CgB,EAAAA,IAAC,MAAA,CAAI,UAAWD,EAAAA,QAAO,uBAAuB,EAC5C,SAAAC,MAAC,QAAK,UAAWD,EAAAA,QAAO,kCAAkC,EACvD,WACH,CAAA,CACF,CAAA,EAEJ,EACCX,GACCY,EAAAA,IAAC,MAAA,CAAI,UAAWD,EAAAA,QAAO,kBAAkB,EACvC,SAAAC,EAAAA,IAAC,OAAA,CACC,UAAW,CACTD,EAAAA,QAAO,4BAA4B,EAClCZ,EAEG,GADAY,UAAO,mCAAmC,CAC1C,EAEH,OAAO,OAAO,EACd,KAAK,GAAG,EAEV,SAAAZ,SAAmBe,EAAAA,QAAA,CAAK,YAAQI,EAAA,CAAA,CAAU,EAAI,KAAK,IAAA,CAAK,CAAA,CAAA,CAC3D,CACF,CAAA,CAAA,CAEJ,CAAA,CACF,CAEJ"}
|
|
@@ -6,11 +6,11 @@ export interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
6
6
|
secondaryLabel?: ReactNode;
|
|
7
7
|
/** Where the secondary label appears. Default: 'below'. */
|
|
8
8
|
secondaryLabelPosition?: 'inline' | 'below';
|
|
9
|
-
/** Custom content for the leading slot. When omitted, shows placeholder icon. */
|
|
9
|
+
/** Custom content for the leading slot. When omitted, shows placeholder icon. When passing an icon, use `<Icon glyph={<SomeIcon />} size="16" />`. */
|
|
10
10
|
leadingVisual?: ReactNode;
|
|
11
11
|
/** Show the leading visual slot. Default: true. */
|
|
12
12
|
leadingElement?: boolean;
|
|
13
|
-
/** Custom content for the trailing slot. When omitted with trailingElement=true, shows check icon. */
|
|
13
|
+
/** Custom content for the trailing slot. When omitted with trailingElement=true, shows check icon. When passing an icon, use `<Icon glyph={<SomeIcon />} size="16" />`. */
|
|
14
14
|
trailingVisual?: ReactNode;
|
|
15
15
|
/** Show the trailing visual slot. Default: false. */
|
|
16
16
|
trailingElement?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../src/components/menu-item/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQ7D,MAAM,WAAW,aAAc,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC5E,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,2DAA2D;IAC3D,sBAAsB,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC5C,
|
|
1
|
+
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../src/components/menu-item/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQ7D,MAAM,WAAW,aAAc,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC5E,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,2DAA2D;IAC3D,sBAAsB,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC5C,sJAAsJ;IACtJ,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,mDAAmD;IACnD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2KAA2K;IAC3K,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,qDAAqD;IACrD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4BAA4B;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oEAAoE;IACpE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,KAAK,EACL,cAAc,EACd,sBAAgC,EAChC,aAAa,EACb,cAAqB,EACrB,cAAc,EACd,eAAuB,EACvB,iBAAiB,EACjB,GAAW,EACX,YAAY,EACZ,WAAmB,EACnB,MAAc,EACd,SAAc,EACd,QAAQ,EACR,IAAe,EACf,GAAG,IAAI,EACR,EAAE,aAAa,2CAuEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sources":["../../../src/components/menu-item/MenuItem.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes, ReactNode } from 'react';\nimport EmoticonHappyOutlineIcon from '@mattermost/compass-icons/components/emoticon-happy-outline';\nimport CheckIcon from '@mattermost/compass-icons/components/check';\nimport Icon from '@/components/icon/Icon';\nimport Tag from '@/components/tag/Tag';\nimport MentionBadge from '@/components/mention-badge/MentionBadge';\nimport styles from './MenuItem.module.scss';\n\nexport interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Primary label text. */\n label: string;\n /** Optional secondary label. */\n secondaryLabel?: ReactNode;\n /** Where the secondary label appears. Default: 'below'. */\n secondaryLabelPosition?: 'inline' | 'below';\n /** Custom content for the leading slot. When omitted, shows placeholder icon. */\n leadingVisual?: ReactNode;\n /** Show the leading visual slot. Default: true. */\n leadingElement?: boolean;\n /** Custom content for the trailing slot. When omitted with trailingElement=true, shows check icon. */\n trailingVisual?: ReactNode;\n /** Show the trailing visual slot. Default: false. */\n trailingElement?: boolean;\n /** Emoji character for custom status, shown inline after the label. */\n customStatusEmoji?: string;\n /** Show \"NEW\" label tag. */\n tag?: boolean;\n /** Inline mention count badge. */\n mentionCount?: number;\n /** Destructive (danger) styling. */\n destructive?: boolean;\n /** Highlight row (e.g. submenu parent while child menu is open). */\n active?: boolean;\n}\n\n/**\n * Menu Items are the rows inside a Menu — the smallest selectable unit in any dropdown,\n * kebab, or context menu. One label, optional supporting visuals, and a clear hit target.\n */\nexport default function MenuItem({\n label,\n secondaryLabel,\n secondaryLabelPosition = 'below',\n leadingVisual,\n leadingElement = true,\n trailingVisual,\n trailingElement = false,\n customStatusEmoji,\n tag = false,\n mentionCount,\n destructive = false,\n active = false,\n className = '',\n disabled,\n type = 'button',\n ...rest\n}: MenuItemProps) {\n const rootClass = [\n styles['menu-item'],\n destructive ? styles['menu-item--destructive'] : '',\n active ? styles['menu-item--active'] : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <button className={rootClass} type={type} disabled={disabled} {...rest}>\n <div className={styles['menu-item__content']}>\n {leadingElement && (\n <div className={styles['menu-item__left']}>\n <span className={styles['menu-item__leading-visual']} aria-hidden>\n {leadingVisual ?? (\n <Icon glyph={<EmoticonHappyOutlineIcon />} size=\"16\" />\n )}\n </span>\n </div>\n )}\n <div className={styles['menu-item__middle']}>\n <div className={styles['menu-item__top-row']}>\n <span className={styles['menu-item__label']}>{label}</span>\n {secondaryLabel && secondaryLabelPosition === 'inline' && (\n <span className={styles['menu-item__secondary-label-inline']}>\n {secondaryLabel}\n </span>\n )}\n {customStatusEmoji && (\n <span className={styles['menu-item__custom-status']} aria-hidden>\n {customStatusEmoji}\n </span>\n )}\n {tag && <Tag label=\"NEW\" />}\n {mentionCount != null && mentionCount > 0 && (\n <MentionBadge\n count={mentionCount}\n location=\"menu-item\"\n size=\"small\"\n />\n )}\n </div>\n {secondaryLabel && secondaryLabelPosition === 'below' && (\n <div className={styles['menu-item__bottom-row']}>\n <span className={styles['menu-item__secondary-label-below']}>\n {secondaryLabel}\n </span>\n </div>\n )}\n </div>\n {trailingElement && (\n <div className={styles['menu-item__right']}>\n <span\n className={[\n styles['menu-item__trailing-visual'],\n !trailingVisual\n ? styles['menu-item__trailing-visual--check']\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {trailingVisual ?? <Icon glyph={<CheckIcon />} size=\"16\" />}\n </span>\n </div>\n )}\n </div>\n </button>\n );\n}\n"],"names":["MenuItem","label","secondaryLabel","secondaryLabelPosition","leadingVisual","leadingElement","trailingVisual","trailingElement","customStatusEmoji","tag","mentionCount","destructive","active","className","disabled","type","rest","rootClass","styles","jsx","jsxs","Icon","EmoticonHappyOutlineIcon","Tag","MentionBadge","CheckIcon"],"mappings":";;;;;;;AAuCA,SAAwBA,EAAS;AAAA,EAC/B,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,wBAAAC,IAAyB;AAAA,EACzB,eAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,gBAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,mBAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,GAAGC;AACL,GAAkB;AAChB,QAAMC,IAAY;AAAA,IAChBC,EAAO,WAAW;AAAA,IAClBP,IAAcO,EAAO,wBAAwB,IAAI;AAAA,IACjDN,IAASM,EAAO,mBAAmB,IAAI;AAAA,IACvCL;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,gBAAAM,EAAC,UAAA,EAAO,WAAWF,GAAW,MAAAF,GAAY,UAAAD,GAAqB,GAAGE,GAChE,UAAA,gBAAAI,EAAC,OAAA,EAAI,WAAWF,EAAO,oBAAoB,GACxC,UAAA;AAAA,IAAAb,KACC,gBAAAc,EAAC,OAAA,EAAI,WAAWD,EAAO,iBAAiB,GACtC,UAAA,gBAAAC,EAAC,QAAA,EAAK,WAAWD,EAAO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Z,uBAAmBe,GAAA,EAAK,yBAAQI,GAAA,CAAA,CAAU,GAAI,MAAK,KAAA,CAAK;AAAA,MAAA;AAAA,IAAA,EAC3D,CACF;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sources":["../../../src/components/menu-item/MenuItem.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes, ReactNode } from 'react';\nimport EmoticonHappyOutlineIcon from '@mattermost/compass-icons/components/emoticon-happy-outline';\nimport CheckIcon from '@mattermost/compass-icons/components/check';\nimport Icon from '@/components/icon/Icon';\nimport Tag from '@/components/tag/Tag';\nimport MentionBadge from '@/components/mention-badge/MentionBadge';\nimport styles from './MenuItem.module.scss';\n\nexport interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Primary label text. */\n label: string;\n /** Optional secondary label. */\n secondaryLabel?: ReactNode;\n /** Where the secondary label appears. Default: 'below'. */\n secondaryLabelPosition?: 'inline' | 'below';\n /** Custom content for the leading slot. When omitted, shows placeholder icon. When passing an icon, use `<Icon glyph={<SomeIcon />} size=\"16\" />`. */\n leadingVisual?: ReactNode;\n /** Show the leading visual slot. Default: true. */\n leadingElement?: boolean;\n /** Custom content for the trailing slot. When omitted with trailingElement=true, shows check icon. When passing an icon, use `<Icon glyph={<SomeIcon />} size=\"16\" />`. */\n trailingVisual?: ReactNode;\n /** Show the trailing visual slot. Default: false. */\n trailingElement?: boolean;\n /** Emoji character for custom status, shown inline after the label. */\n customStatusEmoji?: string;\n /** Show \"NEW\" label tag. */\n tag?: boolean;\n /** Inline mention count badge. */\n mentionCount?: number;\n /** Destructive (danger) styling. */\n destructive?: boolean;\n /** Highlight row (e.g. submenu parent while child menu is open). */\n active?: boolean;\n}\n\n/**\n * Menu Items are the rows inside a Menu — the smallest selectable unit in any dropdown,\n * kebab, or context menu. One label, optional supporting visuals, and a clear hit target.\n */\nexport default function MenuItem({\n label,\n secondaryLabel,\n secondaryLabelPosition = 'below',\n leadingVisual,\n leadingElement = true,\n trailingVisual,\n trailingElement = false,\n customStatusEmoji,\n tag = false,\n mentionCount,\n destructive = false,\n active = false,\n className = '',\n disabled,\n type = 'button',\n ...rest\n}: MenuItemProps) {\n const rootClass = [\n styles['menu-item'],\n destructive ? styles['menu-item--destructive'] : '',\n active ? styles['menu-item--active'] : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <button className={rootClass} type={type} disabled={disabled} {...rest}>\n <div className={styles['menu-item__content']}>\n {leadingElement && (\n <div className={styles['menu-item__left']}>\n <span className={styles['menu-item__leading-visual']} aria-hidden>\n {leadingVisual ?? (\n <Icon glyph={<EmoticonHappyOutlineIcon />} size=\"16\" />\n )}\n </span>\n </div>\n )}\n <div className={styles['menu-item__middle']}>\n <div className={styles['menu-item__top-row']}>\n <span className={styles['menu-item__label']}>{label}</span>\n {secondaryLabel && secondaryLabelPosition === 'inline' && (\n <span className={styles['menu-item__secondary-label-inline']}>\n {secondaryLabel}\n </span>\n )}\n {customStatusEmoji && (\n <span className={styles['menu-item__custom-status']} aria-hidden>\n {customStatusEmoji}\n </span>\n )}\n {tag && <Tag label=\"NEW\" />}\n {mentionCount != null && mentionCount > 0 && (\n <MentionBadge\n count={mentionCount}\n location=\"menu-item\"\n size=\"small\"\n />\n )}\n </div>\n {secondaryLabel && secondaryLabelPosition === 'below' && (\n <div className={styles['menu-item__bottom-row']}>\n <span className={styles['menu-item__secondary-label-below']}>\n {secondaryLabel}\n </span>\n </div>\n )}\n </div>\n {trailingElement && (\n <div className={styles['menu-item__right']}>\n <span\n className={[\n styles['menu-item__trailing-visual'],\n !trailingVisual\n ? styles['menu-item__trailing-visual--check']\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {trailingVisual ?? <Icon glyph={<CheckIcon />} size=\"16\" />}\n </span>\n </div>\n )}\n </div>\n </button>\n );\n}\n"],"names":["MenuItem","label","secondaryLabel","secondaryLabelPosition","leadingVisual","leadingElement","trailingVisual","trailingElement","customStatusEmoji","tag","mentionCount","destructive","active","className","disabled","type","rest","rootClass","styles","jsx","jsxs","Icon","EmoticonHappyOutlineIcon","Tag","MentionBadge","CheckIcon"],"mappings":";;;;;;;AAuCA,SAAwBA,EAAS;AAAA,EAC/B,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,wBAAAC,IAAyB;AAAA,EACzB,eAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,gBAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,mBAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,GAAGC;AACL,GAAkB;AAChB,QAAMC,IAAY;AAAA,IAChBC,EAAO,WAAW;AAAA,IAClBP,IAAcO,EAAO,wBAAwB,IAAI;AAAA,IACjDN,IAASM,EAAO,mBAAmB,IAAI;AAAA,IACvCL;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,gBAAAM,EAAC,UAAA,EAAO,WAAWF,GAAW,MAAAF,GAAY,UAAAD,GAAqB,GAAGE,GAChE,UAAA,gBAAAI,EAAC,OAAA,EAAI,WAAWF,EAAO,oBAAoB,GACxC,UAAA;AAAA,IAAAb,KACC,gBAAAc,EAAC,OAAA,EAAI,WAAWD,EAAO,iBAAiB,GACtC,UAAA,gBAAAC,EAAC,QAAA,EAAK,WAAWD,EAAO,2BAA2B,GAAG,eAAW,IAC9D,UAAAd,KACC,gBAAAe,EAACE,GAAA,EAAK,OAAO,gBAAAF,EAACG,KAAyB,GAAI,MAAK,KAAA,CAAK,EAAA,CAEzD,EAAA,CACF;AAAA,IAEF,gBAAAF,EAAC,OAAA,EAAI,WAAWF,EAAO,mBAAmB,GACxC,UAAA;AAAA,MAAA,gBAAAE,EAAC,OAAA,E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value:"Module"}});const e=require("react/jsx-runtime"),m=require("../icon/Icon.cjs"),__c=require("@mattermost/compass-icons/components/creation-outline.js"),c=__c?.default??__c,a=require("./MessageSeparator.module.scss.cjs"),g={date:"Today","new-messages":"
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),m=require("../icon/Icon.cjs"),__c=require("@mattermost/compass-icons/components/creation-outline.js"),c=__c?.default??__c,a=require("./MessageSeparator.module.scss.cjs"),g={date:"Today","new-messages":"New messages","reply-count":"4 replies"};function p({type:s="date",label:t,showAiSummary:l=!1,onSummarize:i,className:n="",...d}){const o=t??g[s],u=[a.default["message-separator"],a.default[`message-separator--${s==="new-messages"?"new":s==="reply-count"?"reply":"date"}`],n].filter(Boolean).join(" "),r=e.jsxs("div",{className:a.default["message-separator__label"],children:[e.jsx("span",{className:a.default["message-separator__text"],children:o}),s==="new-messages"&&l&&e.jsxs("button",{type:"button",className:a.default["message-separator__summarize"],onClick:i,"aria-label":"Summarize new messages with AI",children:[e.jsx("span",{className:a.default["message-separator__summarize-icon"],"aria-hidden":!0,children:e.jsx(m.default,{size:"12",glyph:e.jsx(c,{})})}),"Summarize"]})]});return e.jsx("div",{className:u,role:"separator",...d,children:s==="reply-count"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.default["message-separator__reply-gutter"],"aria-hidden":!0,children:e.jsx("div",{className:a.default["message-separator__reply-line-start"]})}),r,e.jsx("div",{className:a.default["message-separator__line"],"aria-hidden":!0})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.default["message-separator__line"],"aria-hidden":!0}),r,e.jsx("div",{className:a.default["message-separator__line"],"aria-hidden":!0})]})})}exports.default=p;
|
|
2
2
|
//# sourceMappingURL=MessageSeparator.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageSeparator.cjs","sources":["../../../src/components/message-separator/MessageSeparator.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport Icon from '@/components/icon/Icon';\nimport CreationOutlineIcon from '@mattermost/compass-icons/components/creation-outline';\nimport styles from './MessageSeparator.module.scss';\n\nexport type MessageSeparatorType = 'date' | 'new-messages' | 'reply-count';\n\nexport interface MessageSeparatorProps extends HTMLAttributes<HTMLDivElement> {\n /** Separator variant. Default: Date. */\n type?: MessageSeparatorType;\n /** Label text. Defaults: 'Today' / '
|
|
1
|
+
{"version":3,"file":"MessageSeparator.cjs","sources":["../../../src/components/message-separator/MessageSeparator.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport Icon from '@/components/icon/Icon';\nimport CreationOutlineIcon from '@mattermost/compass-icons/components/creation-outline';\nimport styles from './MessageSeparator.module.scss';\n\nexport type MessageSeparatorType = 'date' | 'new-messages' | 'reply-count';\n\nexport interface MessageSeparatorProps extends HTMLAttributes<HTMLDivElement> {\n /** Separator variant. Default: Date. */\n type?: MessageSeparatorType;\n /** Label text. Defaults: 'Today' / 'New messages' / '4 replies'. */\n label?: string;\n /** Show AI summarize button (New Messages type only). Default: false. */\n showAiSummary?: boolean;\n /** Called when Summarize button is clicked. */\n onSummarize?: () => void;\n /** Optional CSS class name. */\n className?: string;\n}\n\nconst DEFAULT_LABELS: Record<MessageSeparatorType, string> = {\n date: 'Today',\n 'new-messages': 'New messages',\n 'reply-count': '4 replies',\n};\n\n/**\n * Message Separators sit between messages in the stream to group them — by day, by reply\n * count, or to mark the boundary between read and unread. They help readers orient\n * themselves when scrolling back through history or returning to a busy channel.\n */\nexport default function MessageSeparator({\n type = 'date',\n label,\n showAiSummary = false,\n onSummarize,\n className = '',\n ...rest\n}: MessageSeparatorProps) {\n const displayLabel = label ?? DEFAULT_LABELS[type];\n\n const rootClass = [\n styles['message-separator'],\n styles[\n `message-separator--${type === 'new-messages' ? 'new' : type === 'reply-count' ? 'reply' : 'date'}`\n ],\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const labelBlock = (\n <div className={styles['message-separator__label']}>\n <span className={styles['message-separator__text']}>\n {displayLabel}\n </span>\n\n {type === 'new-messages' && showAiSummary && (\n <button\n type=\"button\"\n className={styles['message-separator__summarize']}\n onClick={onSummarize}\n aria-label=\"Summarize new messages with AI\"\n >\n <span\n className={styles['message-separator__summarize-icon']}\n aria-hidden\n >\n <Icon size=\"12\" glyph={<CreationOutlineIcon />} />\n </span>\n Summarize\n </button>\n )}\n </div>\n );\n\n return (\n <div className={rootClass} role=\"separator\" {...rest}>\n {type === 'reply-count' ? (\n <>\n <div className={styles['message-separator__reply-gutter']} aria-hidden>\n <div className={styles['message-separator__reply-line-start']} />\n </div>\n {labelBlock}\n <div className={styles['message-separator__line']} aria-hidden />\n </>\n ) : (\n <>\n <div className={styles['message-separator__line']} aria-hidden />\n {labelBlock}\n <div className={styles['message-separator__line']} aria-hidden />\n </>\n )}\n </div>\n );\n}\n"],"names":["DEFAULT_LABELS","MessageSeparator","type","label","showAiSummary","onSummarize","className","rest","displayLabel","rootClass","styles","labelBlock","jsxs","jsx","Icon","CreationOutlineIcon","Fragment"],"mappings":"kSAoBMA,EAAuD,CAC3D,KAAM,QACN,eAAgB,eAChB,cAAe,WACjB,EAOA,SAAwBC,EAAiB,CACvC,KAAAC,EAAO,OACP,MAAAC,EACA,cAAAC,EAAgB,GAChB,YAAAC,EACA,UAAAC,EAAY,GACZ,GAAGC,CACL,EAA0B,CACxB,MAAMC,EAAeL,GAASH,EAAeE,CAAI,EAE3CO,EAAY,CAChBC,EAAAA,QAAO,mBAAmB,EAC1BA,EAAAA,QACE,sBAAsBR,IAAS,eAAiB,MAAQA,IAAS,cAAgB,QAAU,MAAM,EACnG,EACAI,CAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,EAELK,EACJC,EAAAA,KAAC,MAAA,CAAI,UAAWF,UAAO,0BAA0B,EAC/C,SAAA,CAAAG,MAAC,OAAA,CAAK,UAAWH,EAAAA,QAAO,yBAAyB,EAC9C,SAAAF,EACH,EAECN,IAAS,gBAAkBE,GAC1BQ,EAAAA,KAAC,SAAA,CACC,KAAK,SACL,UAAWF,EAAAA,QAAO,8BAA8B,EAChD,QAASL,EACT,aAAW,iCAEX,SAAA,CAAAQ,EAAAA,IAAC,OAAA,CACC,UAAWH,EAAAA,QAAO,mCAAmC,EACrD,cAAW,GAEX,eAACI,EAAAA,QAAA,CAAK,KAAK,KAAK,MAAOD,EAAAA,IAACE,IAAoB,CAAA,CAAI,CAAA,CAAA,EAC3C,WAAA,CAAA,CAAA,CAET,EAEJ,EAGF,OACEF,EAAAA,IAAC,MAAA,CAAI,UAAWJ,EAAW,KAAK,YAAa,GAAGF,EAC7C,SAAAL,IAAS,cACRU,EAAAA,KAAAI,EAAAA,SAAA,CACE,SAAA,CAAAH,EAAAA,IAAC,MAAA,CAAI,UAAWH,EAAAA,QAAO,iCAAiC,EAAG,cAAW,GACpE,SAAAG,EAAAA,IAAC,MAAA,CAAI,UAAWH,EAAAA,QAAO,qCAAqC,EAAG,EACjE,EACCC,QACA,MAAA,CAAI,UAAWD,EAAAA,QAAO,yBAAyB,EAAG,cAAW,EAAA,CAAC,CAAA,CAAA,CACjE,EAEAE,EAAAA,KAAAI,EAAAA,SAAA,CACE,SAAA,CAAAH,MAAC,OAAI,UAAWH,EAAAA,QAAO,yBAAyB,EAAG,cAAW,GAAC,EAC9DC,QACA,MAAA,CAAI,UAAWD,EAAAA,QAAO,yBAAyB,EAAG,cAAW,EAAA,CAAC,CAAA,CAAA,CACjE,CAAA,CAEJ,CAEJ"}
|
|
@@ -3,7 +3,7 @@ export type MessageSeparatorType = 'date' | 'new-messages' | 'reply-count';
|
|
|
3
3
|
export interface MessageSeparatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/** Separator variant. Default: Date. */
|
|
5
5
|
type?: MessageSeparatorType;
|
|
6
|
-
/** Label text. Defaults: 'Today' / '
|
|
6
|
+
/** Label text. Defaults: 'Today' / 'New messages' / '4 replies'. */
|
|
7
7
|
label?: string;
|
|
8
8
|
/** Show AI summarize button (New Messages type only). Default: false. */
|
|
9
9
|
showAiSummary?: boolean;
|
|
@@ -4,7 +4,7 @@ import __u from "@mattermost/compass-icons/components/creation-outline.js";const
|
|
|
4
4
|
import e from "./MessageSeparator.module.scss.js";
|
|
5
5
|
const _ = {
|
|
6
6
|
date: "Today",
|
|
7
|
-
"new-messages": "
|
|
7
|
+
"new-messages": "New messages",
|
|
8
8
|
"reply-count": "4 replies"
|
|
9
9
|
};
|
|
10
10
|
function w({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageSeparator.js","sources":["../../../src/components/message-separator/MessageSeparator.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport Icon from '@/components/icon/Icon';\nimport CreationOutlineIcon from '@mattermost/compass-icons/components/creation-outline';\nimport styles from './MessageSeparator.module.scss';\n\nexport type MessageSeparatorType = 'date' | 'new-messages' | 'reply-count';\n\nexport interface MessageSeparatorProps extends HTMLAttributes<HTMLDivElement> {\n /** Separator variant. Default: Date. */\n type?: MessageSeparatorType;\n /** Label text. Defaults: 'Today' / '
|
|
1
|
+
{"version":3,"file":"MessageSeparator.js","sources":["../../../src/components/message-separator/MessageSeparator.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport Icon from '@/components/icon/Icon';\nimport CreationOutlineIcon from '@mattermost/compass-icons/components/creation-outline';\nimport styles from './MessageSeparator.module.scss';\n\nexport type MessageSeparatorType = 'date' | 'new-messages' | 'reply-count';\n\nexport interface MessageSeparatorProps extends HTMLAttributes<HTMLDivElement> {\n /** Separator variant. Default: Date. */\n type?: MessageSeparatorType;\n /** Label text. Defaults: 'Today' / 'New messages' / '4 replies'. */\n label?: string;\n /** Show AI summarize button (New Messages type only). Default: false. */\n showAiSummary?: boolean;\n /** Called when Summarize button is clicked. */\n onSummarize?: () => void;\n /** Optional CSS class name. */\n className?: string;\n}\n\nconst DEFAULT_LABELS: Record<MessageSeparatorType, string> = {\n date: 'Today',\n 'new-messages': 'New messages',\n 'reply-count': '4 replies',\n};\n\n/**\n * Message Separators sit between messages in the stream to group them — by day, by reply\n * count, or to mark the boundary between read and unread. They help readers orient\n * themselves when scrolling back through history or returning to a busy channel.\n */\nexport default function MessageSeparator({\n type = 'date',\n label,\n showAiSummary = false,\n onSummarize,\n className = '',\n ...rest\n}: MessageSeparatorProps) {\n const displayLabel = label ?? DEFAULT_LABELS[type];\n\n const rootClass = [\n styles['message-separator'],\n styles[\n `message-separator--${type === 'new-messages' ? 'new' : type === 'reply-count' ? 'reply' : 'date'}`\n ],\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const labelBlock = (\n <div className={styles['message-separator__label']}>\n <span className={styles['message-separator__text']}>\n {displayLabel}\n </span>\n\n {type === 'new-messages' && showAiSummary && (\n <button\n type=\"button\"\n className={styles['message-separator__summarize']}\n onClick={onSummarize}\n aria-label=\"Summarize new messages with AI\"\n >\n <span\n className={styles['message-separator__summarize-icon']}\n aria-hidden\n >\n <Icon size=\"12\" glyph={<CreationOutlineIcon />} />\n </span>\n Summarize\n </button>\n )}\n </div>\n );\n\n return (\n <div className={rootClass} role=\"separator\" {...rest}>\n {type === 'reply-count' ? (\n <>\n <div className={styles['message-separator__reply-gutter']} aria-hidden>\n <div className={styles['message-separator__reply-line-start']} />\n </div>\n {labelBlock}\n <div className={styles['message-separator__line']} aria-hidden />\n </>\n ) : (\n <>\n <div className={styles['message-separator__line']} aria-hidden />\n {labelBlock}\n <div className={styles['message-separator__line']} aria-hidden />\n </>\n )}\n </div>\n );\n}\n"],"names":["DEFAULT_LABELS","MessageSeparator","type","label","showAiSummary","onSummarize","className","rest","displayLabel","rootClass","styles","labelBlock","jsxs","jsx","Icon","CreationOutlineIcon","Fragment"],"mappings":";;;;AAoBA,MAAMA,IAAuD;AAAA,EAC3D,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,eAAe;AACjB;AAOA,SAAwBC,EAAiB;AAAA,EACvC,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,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AO,yBAAyB,GAAG,eAAW,GAAA,CAAC;AAAA,EAAA,EAAA,CACjE,IAEA,gBAAAE,EAAAI,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAH,EAAC,SAAI,WAAWH,EAAO,yBAAyB,GAAG,eAAW,IAAC;AAAA,IAC9DC;AAAA,sBACA,OAAA,EAAI,WAAWD,EAAO,yBAAyB,GAAG,eAAW,GAAA,CAAC;AAAA,EAAA,EAAA,CACjE,EAAA,CAEJ;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),S=require("react"),p=require("../scrollbar/Scrollbar.cjs"),w=require("../modal-footer/ModalFooter.cjs"),z=require("../modal-header/ModalHeader.cjs"),B=require("../../utils/string.cjs"),l=require("./Modal.module.scss.cjs");function C({className:t="",style:i,size:u="small",title:c,subtitle:m,subtitlePlacement:b="below",hideTitle:f=!1,showBackButton:_=!1,onBack:j,onClose:q,headerDivider:v=!0,headerAction:x,bodyPadding:s="default",scrollable:y=!0,children:M,footer:o,footerLeading:r,footerType:a="2-actions",footerDivider:h=!0}){const d=S.useId(),g=l.default[`modal--size-${B.toKebab(u)}`],I=[l.default["modal__body-inner"],s==="menu"&&l.default["modal__body-inner--menu"],s==="none"&&l.default["modal__body-inner--none"]].filter(Boolean).join(" "),n=e.jsx("div",{className:I,children:M}),N=o!=null||r!=null||a==="spacer-small"||a==="spacer-large";return e.jsxs("div",{className:[l.default.modal,g,t].filter(Boolean).join(" "),style:i,role:"dialog","aria-modal":"true","aria-labelledby":d,children:[e.jsx(z.default,{title:c,titleId:d,subtitle:m,subtitlePlacement:b,hideTitle:f,showBackButton:_,onBack:j,onClose:q,divider:v,headerAction:x}),e.jsx("div",{className:l.default.modal__body,children:y?e.jsx(p.default,{children:n}):n}),N&&e.jsx(w.default,{type:a,divider:h,leading:r,children:o})]})}exports.default=C;
|
|
2
2
|
//# sourceMappingURL=Modal.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.cjs","sources":["../../../src/components/modal/Modal.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { useId } from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"Modal.cjs","sources":["../../../src/components/modal/Modal.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport { useId } from 'react';\nimport Scrollbar from '@/components/scrollbar/Scrollbar';\nimport ModalFooter from '@/components/modal-footer/ModalFooter';\nimport type { ModalFooterType } from '@/components/modal-footer/ModalFooter';\nimport ModalHeader from '@/components/modal-header/ModalHeader';\nimport type { ModalSubtitlePlacement } from '@/components/modal-header/ModalHeader';\nimport { toKebab } from '@/utils/string';\nimport styles from './Modal.module.scss';\n\nexport type ModalSize = 'small' | 'medium' | 'large';\n\n/**\n * Body inset. `menu` is for MenuItem lists — 8px vertical / 16px horizontal so\n * row labels align with the 32px header/footer margins. `none` removes inset\n * for host-owned full-bleed layouts (e.g. settings sidebars).\n */\nexport type ModalBodyPadding = 'default' | 'menu' | 'none';\n\nexport type { ModalFooterType, ModalSubtitlePlacement };\n\nexport interface ModalProps {\n /** Extra class on the dialog root (size + chrome classes still apply). */\n className?: string;\n /** Inline style on the dialog root — prefer `className` for layout overrides. */\n style?: CSSProperties;\n /** Width variant. Figma: Size — Small 600px, Medium 704px, Large 832px. */\n size?: ModalSize;\n /** Modal heading text. Required for a11y; use `hideTitle` for close-only chrome. */\n title: ReactNode;\n /** Optional secondary line — placement via `subtitlePlacement`. */\n subtitle?: ReactNode;\n /**\n * Where the subtitle sits. Figma Modal Header: Below | Beside.\n * Default: `below`.\n */\n subtitlePlacement?: ModalSubtitlePlacement;\n /** Visually hide the title (close-only header); title remains for `aria-labelledby`. */\n hideTitle?: boolean;\n /** When true, shows a back-arrow button before the title. */\n showBackButton?: boolean;\n /** Called when the back button is clicked. */\n onBack?: () => void;\n /** Called when the × close button is clicked. */\n onClose?: () => void;\n /** Show divider between header and body. Default: true. */\n headerDivider?: boolean;\n /** Optional control before close (Button, search field, …). */\n headerAction?: ReactNode;\n /**\n * Body inset. Default is 32px horizontal / 28px vertical. Use `menu` for\n * MenuItem lists. Use `none` when the host owns padding.\n */\n bodyPadding?: ModalBodyPadding;\n /**\n * When true (default), wraps body content in Scrollbar. Set false when the\n * host manages scroll inside panes.\n */\n scrollable?: boolean;\n /** Body content. */\n children: ReactNode;\n /** Footer slot — typically Buttons. Wrapped in `ModalFooter`. */\n footer?: ReactNode;\n /** Left footer slot (pagination status, PaginationDots, …). */\n footerLeading?: ReactNode;\n /** Footer layout. Figma Modal Footer Type. Default: `2-actions`. */\n footerType?: ModalFooterType;\n /** Show divider between body and footer. Default: true. */\n footerDivider?: boolean;\n}\n\n/**\n * Modal dialog shell — composes ModalHeader, scrollable body, and ModalFooter.\n * Host owns portal, overlay, focus trap, and open/close.\n */\nexport default function Modal({\n className = '',\n style,\n size = 'small',\n title,\n subtitle,\n subtitlePlacement = 'below',\n hideTitle = false,\n showBackButton = false,\n onBack,\n onClose,\n headerDivider = true,\n headerAction,\n bodyPadding = 'default',\n scrollable = true,\n children,\n footer,\n footerLeading,\n footerType = '2-actions',\n footerDivider = true,\n}: ModalProps) {\n const titleId = useId();\n const sizeClass = styles[`modal--size-${toKebab(size)}`];\n const bodyInnerClass = [\n styles['modal__body-inner'],\n bodyPadding === 'menu' && styles['modal__body-inner--menu'],\n bodyPadding === 'none' && styles['modal__body-inner--none'],\n ]\n .filter(Boolean)\n .join(' ');\n\n const bodyInner = <div className={bodyInnerClass}>{children}</div>;\n const showFooter =\n footer != null ||\n footerLeading != null ||\n footerType === 'spacer-small' ||\n footerType === 'spacer-large';\n\n return (\n <div\n className={[styles.modal, sizeClass, className].filter(Boolean).join(' ')}\n style={style}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n >\n <ModalHeader\n title={title}\n titleId={titleId}\n subtitle={subtitle}\n subtitlePlacement={subtitlePlacement}\n hideTitle={hideTitle}\n showBackButton={showBackButton}\n onBack={onBack}\n onClose={onClose}\n divider={headerDivider}\n headerAction={headerAction}\n />\n\n <div className={styles['modal__body']}>\n {scrollable ? <Scrollbar>{bodyInner}</Scrollbar> : bodyInner}\n </div>\n\n {showFooter && (\n <ModalFooter\n type={footerType}\n divider={footerDivider}\n leading={footerLeading}\n >\n {footer}\n </ModalFooter>\n )}\n </div>\n );\n}\n"],"names":["Modal","className","style","size","title","subtitle","subtitlePlacement","hideTitle","showBackButton","onBack","onClose","headerDivider","headerAction","bodyPadding","scrollable","children","footer","footerLeading","footerType","footerDivider","titleId","useId","sizeClass","styles","toKebab","bodyInnerClass","bodyInner","jsx","showFooter","jsxs","ModalHeader","Scrollbar","ModalFooter"],"mappings":"6WA2EA,SAAwBA,EAAM,CAC5B,UAAAC,EAAY,GACZ,MAAAC,EACA,KAAAC,EAAO,QACP,MAAAC,EACA,SAAAC,EACA,kBAAAC,EAAoB,QACpB,UAAAC,EAAY,GACZ,eAAAC,EAAiB,GACjB,OAAAC,EACA,QAAAC,EACA,cAAAC,EAAgB,GAChB,aAAAC,EACA,YAAAC,EAAc,UACd,WAAAC,EAAa,GACb,SAAAC,EACA,OAAAC,EACA,cAAAC,EACA,WAAAC,EAAa,YACb,cAAAC,EAAgB,EAClB,EAAe,CACb,MAAMC,EAAUC,EAAAA,MAAA,EACVC,EAAYC,EAAAA,QAAO,eAAeC,EAAAA,QAAQrB,CAAI,CAAC,EAAE,EACjDsB,EAAiB,CACrBF,EAAAA,QAAO,mBAAmB,EAC1BV,IAAgB,QAAUU,EAAAA,QAAO,yBAAyB,EAC1DV,IAAgB,QAAUU,EAAAA,QAAO,yBAAyB,CAAA,EAEzD,OAAO,OAAO,EACd,KAAK,GAAG,EAELG,EAAYC,EAAAA,IAAC,MAAA,CAAI,UAAWF,EAAiB,SAAAV,EAAS,EACtDa,EACJZ,GAAU,MACVC,GAAiB,MACjBC,IAAe,gBACfA,IAAe,eAEjB,OACEW,EAAAA,KAAC,MAAA,CACC,UAAW,CAACN,EAAAA,QAAO,MAAOD,EAAWrB,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EACxE,MAAAC,EACA,KAAK,SACL,aAAW,OACX,kBAAiBkB,EAEjB,SAAA,CAAAO,EAAAA,IAACG,EAAAA,QAAA,CACC,MAAA1B,EACA,QAAAgB,EACA,SAAAf,EACA,kBAAAC,EACA,UAAAC,EACA,eAAAC,EACA,OAAAC,EACA,QAAAC,EACA,QAASC,EACT,aAAAC,CAAA,CAAA,EAGFe,EAAAA,IAAC,MAAA,CAAI,UAAWJ,EAAAA,QAAO,YACpB,SAAAT,EAAaa,EAAAA,IAACI,EAAAA,QAAA,CAAW,SAAAL,CAAA,CAAU,EAAeA,EACrD,EAECE,GACCD,EAAAA,IAACK,EAAAA,QAAA,CACC,KAAMd,EACN,QAASC,EACT,QAASF,EAER,SAAAD,CAAA,CAAA,CACH,CAAA,CAAA,CAIR"}
|
|
@@ -1,34 +1,66 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { ModalFooterType } from '../modal-footer/ModalFooter';
|
|
3
|
+
import { ModalSubtitlePlacement } from '../modal-header/ModalHeader';
|
|
2
4
|
export type ModalSize = 'small' | 'medium' | 'large';
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Body inset. `menu` is for MenuItem lists — 8px vertical / 16px horizontal so
|
|
7
|
+
* row labels align with the 32px header/footer margins. `none` removes inset
|
|
8
|
+
* for host-owned full-bleed layouts (e.g. settings sidebars).
|
|
9
|
+
*/
|
|
10
|
+
export type ModalBodyPadding = 'default' | 'menu' | 'none';
|
|
11
|
+
export type { ModalFooterType, ModalSubtitlePlacement };
|
|
5
12
|
export interface ModalProps {
|
|
13
|
+
/** Extra class on the dialog root (size + chrome classes still apply). */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Inline style on the dialog root — prefer `className` for layout overrides. */
|
|
16
|
+
style?: CSSProperties;
|
|
6
17
|
/** Width variant. Figma: Size — Small 600px, Medium 704px, Large 832px. */
|
|
7
18
|
size?: ModalSize;
|
|
8
|
-
/** Modal heading text.
|
|
19
|
+
/** Modal heading text. Required for a11y; use `hideTitle` for close-only chrome. */
|
|
9
20
|
title: ReactNode;
|
|
10
|
-
/** Optional secondary line
|
|
21
|
+
/** Optional secondary line — placement via `subtitlePlacement`. */
|
|
11
22
|
subtitle?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Where the subtitle sits. Figma Modal Header: Below | Beside.
|
|
25
|
+
* Default: `below`.
|
|
26
|
+
*/
|
|
27
|
+
subtitlePlacement?: ModalSubtitlePlacement;
|
|
28
|
+
/** Visually hide the title (close-only header); title remains for `aria-labelledby`. */
|
|
29
|
+
hideTitle?: boolean;
|
|
12
30
|
/** When true, shows a back-arrow button before the title. */
|
|
13
31
|
showBackButton?: boolean;
|
|
14
32
|
/** Called when the back button is clicked. */
|
|
15
33
|
onBack?: () => void;
|
|
16
34
|
/** Called when the × close button is clicked. */
|
|
17
35
|
onClose?: () => void;
|
|
18
|
-
/** Show divider between header and body.
|
|
36
|
+
/** Show divider between header and body. Default: true. */
|
|
19
37
|
headerDivider?: boolean;
|
|
38
|
+
/** Optional control before close (Button, search field, …). */
|
|
39
|
+
headerAction?: ReactNode;
|
|
20
40
|
/**
|
|
21
41
|
* Body inset. Default is 32px horizontal / 28px vertical. Use `menu` for
|
|
22
|
-
* MenuItem lists
|
|
23
|
-
* the 32px header/footer margins).
|
|
42
|
+
* MenuItem lists. Use `none` when the host owns padding.
|
|
24
43
|
*/
|
|
25
44
|
bodyPadding?: ModalBodyPadding;
|
|
45
|
+
/**
|
|
46
|
+
* When true (default), wraps body content in Scrollbar. Set false when the
|
|
47
|
+
* host manages scroll inside panes.
|
|
48
|
+
*/
|
|
49
|
+
scrollable?: boolean;
|
|
26
50
|
/** Body content. */
|
|
27
51
|
children: ReactNode;
|
|
28
|
-
/** Footer slot — typically
|
|
52
|
+
/** Footer slot — typically Buttons. Wrapped in `ModalFooter`. */
|
|
29
53
|
footer?: ReactNode;
|
|
30
|
-
/**
|
|
54
|
+
/** Left footer slot (pagination status, PaginationDots, …). */
|
|
55
|
+
footerLeading?: ReactNode;
|
|
56
|
+
/** Footer layout. Figma Modal Footer Type. Default: `2-actions`. */
|
|
57
|
+
footerType?: ModalFooterType;
|
|
58
|
+
/** Show divider between body and footer. Default: true. */
|
|
31
59
|
footerDivider?: boolean;
|
|
32
60
|
}
|
|
33
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Modal dialog shell — composes ModalHeader, scrollable body, and ModalFooter.
|
|
63
|
+
* Host owns portal, overlay, focus trap, and open/close.
|
|
64
|
+
*/
|
|
65
|
+
export default function Modal({ className, style, size, title, subtitle, subtitlePlacement, hideTitle, showBackButton, onBack, onClose, headerDivider, headerAction, bodyPadding, scrollable, children, footer, footerLeading, footerType, footerDivider, }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
34
66
|
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAItD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAInF,MAAM,MAAM,SAAS,G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AK,CAAC,EAC5B,SAAc,EACd,KAAK,EACL,IAAc,EACd,KAAK,EACL,QAAQ,EACR,iBAA2B,EAC3B,SAAiB,EACjB,cAAsB,EACtB,MAAM,EACN,OAAO,EACP,aAAoB,EACpB,YAAY,EACZ,WAAuB,EACvB,UAAiB,EACjB,QAAQ,EACR,MAAM,EACN,aAAa,EACb,UAAwB,EACxB,aAAoB,GACrB,EAAE,UAAU,2CAsDZ"}
|
|
@@ -1,86 +1,68 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
size:
|
|
12
|
-
title:
|
|
13
|
-
subtitle:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { jsxs as z, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useId as B } from "react";
|
|
3
|
+
import C from "../scrollbar/Scrollbar.js";
|
|
4
|
+
import F from "../modal-footer/ModalFooter.js";
|
|
5
|
+
import g from "../modal-header/ModalHeader.js";
|
|
6
|
+
import { toKebab as H } from "../../utils/string.js";
|
|
7
|
+
import l from "./Modal.module.scss.js";
|
|
8
|
+
function E({
|
|
9
|
+
className: d = "",
|
|
10
|
+
style: m,
|
|
11
|
+
size: t = "small",
|
|
12
|
+
title: c,
|
|
13
|
+
subtitle: u,
|
|
14
|
+
subtitlePlacement: b = "below",
|
|
15
|
+
hideTitle: f = !1,
|
|
16
|
+
showBackButton: p = !1,
|
|
17
|
+
onBack: _,
|
|
18
|
+
onClose: y,
|
|
19
|
+
headerDivider: h = !0,
|
|
20
|
+
headerAction: v,
|
|
21
|
+
bodyPadding: r = "default",
|
|
22
|
+
scrollable: j = !0,
|
|
23
|
+
children: I,
|
|
24
|
+
footer: a,
|
|
25
|
+
footerLeading: n,
|
|
26
|
+
footerType: e = "2-actions",
|
|
27
|
+
footerDivider: x = !0
|
|
22
28
|
}) {
|
|
23
|
-
const
|
|
24
|
-
|
|
29
|
+
const i = B(), M = l[`modal--size-${H(t)}`], N = [
|
|
30
|
+
l["modal__body-inner"],
|
|
31
|
+
r === "menu" && l["modal__body-inner--menu"],
|
|
32
|
+
r === "none" && l["modal__body-inner--none"]
|
|
33
|
+
].filter(Boolean).join(" "), s = /* @__PURE__ */ o("div", { className: N, children: I }), w = a != null || n != null || e === "spacer-small" || e === "spacer-large";
|
|
34
|
+
return /* @__PURE__ */ z(
|
|
25
35
|
"div",
|
|
26
36
|
{
|
|
27
|
-
className: [
|
|
37
|
+
className: [l.modal, M, d].filter(Boolean).join(" "),
|
|
38
|
+
style: m,
|
|
28
39
|
role: "dialog",
|
|
29
40
|
"aria-modal": "true",
|
|
30
|
-
"aria-labelledby":
|
|
41
|
+
"aria-labelledby": i,
|
|
31
42
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
43
|
+
/* @__PURE__ */ o(
|
|
44
|
+
g,
|
|
34
45
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
icon: /* @__PURE__ */ l(m, { glyph: /* @__PURE__ */ l(B, {}), size: "20" }),
|
|
46
|
-
onClick: c
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
/* @__PURE__ */ e("div", { className: o["modal__title-group"], children: [
|
|
50
|
-
/* @__PURE__ */ l("h2", { id: r, className: o.modal__title, children: s }),
|
|
51
|
-
a && /* @__PURE__ */ l("p", { className: o.modal__subtitle, children: a })
|
|
52
|
-
] })
|
|
53
|
-
] }),
|
|
54
|
-
/* @__PURE__ */ l(
|
|
55
|
-
d,
|
|
56
|
-
{
|
|
57
|
-
"aria-label": "Close",
|
|
58
|
-
className: o.modal__close,
|
|
59
|
-
icon: /* @__PURE__ */ l(m, { glyph: /* @__PURE__ */ l(j, {}), size: "20" }),
|
|
60
|
-
onClick: _
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
]
|
|
46
|
+
title: c,
|
|
47
|
+
titleId: i,
|
|
48
|
+
subtitle: u,
|
|
49
|
+
subtitlePlacement: b,
|
|
50
|
+
hideTitle: f,
|
|
51
|
+
showBackButton: p,
|
|
52
|
+
onBack: _,
|
|
53
|
+
onClose: y,
|
|
54
|
+
divider: h,
|
|
55
|
+
headerAction: v
|
|
64
56
|
}
|
|
65
57
|
),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
58
|
+
/* @__PURE__ */ o("div", { className: l.modal__body, children: j ? /* @__PURE__ */ o(C, { children: s }) : s }),
|
|
59
|
+
w && /* @__PURE__ */ o(
|
|
60
|
+
F,
|
|
68
61
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
children: p
|
|
74
|
-
}
|
|
75
|
-
) }) }),
|
|
76
|
-
i && /* @__PURE__ */ l(
|
|
77
|
-
"div",
|
|
78
|
-
{
|
|
79
|
-
className: [
|
|
80
|
-
o.modal__footer,
|
|
81
|
-
!u && o["modal__footer--no-divider"]
|
|
82
|
-
].filter(Boolean).join(" "),
|
|
83
|
-
children: i
|
|
62
|
+
type: e,
|
|
63
|
+
divider: x,
|
|
64
|
+
leading: n,
|
|
65
|
+
children: a
|
|
84
66
|
}
|
|
85
67
|
)
|
|
86
68
|
]
|
|
@@ -88,6 +70,6 @@ function L({
|
|
|
88
70
|
);
|
|
89
71
|
}
|
|
90
72
|
export {
|
|
91
|
-
|
|
73
|
+
E as default
|
|
92
74
|
};
|
|
93
75
|
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../../../src/components/modal/Modal.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { useId } from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../../../src/components/modal/Modal.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport { useId } from 'react';\nimport Scrollbar from '@/components/scrollbar/Scrollbar';\nimport ModalFooter from '@/components/modal-footer/ModalFooter';\nimport type { ModalFooterType } from '@/components/modal-footer/ModalFooter';\nimport ModalHeader from '@/components/modal-header/ModalHeader';\nimport type { ModalSubtitlePlacement } from '@/components/modal-header/ModalHeader';\nimport { toKebab } from '@/utils/string';\nimport styles from './Modal.module.scss';\n\nexport type ModalSize = 'small' | 'medium' | 'large';\n\n/**\n * Body inset. `menu` is for MenuItem lists — 8px vertical / 16px horizontal so\n * row labels align with the 32px header/footer margins. `none` removes inset\n * for host-owned full-bleed layouts (e.g. settings sidebars).\n */\nexport type ModalBodyPadding = 'default' | 'menu' | 'none';\n\nexport type { ModalFooterType, ModalSubtitlePlacement };\n\nexport interface ModalProps {\n /** Extra class on the dialog root (size + chrome classes still apply). */\n className?: string;\n /** Inline style on the dialog root — prefer `className` for layout overrides. */\n style?: CSSProperties;\n /** Width variant. Figma: Size — Small 600px, Medium 704px, Large 832px. */\n size?: ModalSize;\n /** Modal heading text. Required for a11y; use `hideTitle` for close-only chrome. */\n title: ReactNode;\n /** Optional secondary line — placement via `subtitlePlacement`. */\n subtitle?: ReactNode;\n /**\n * Where the subtitle sits. Figma Modal Header: Below | Beside.\n * Default: `below`.\n */\n subtitlePlacement?: ModalSubtitlePlacement;\n /** Visually hide the title (close-only header); title remains for `aria-labelledby`. */\n hideTitle?: boolean;\n /** When true, shows a back-arrow button before the title. */\n showBackButton?: boolean;\n /** Called when the back button is clicked. */\n onBack?: () => void;\n /** Called when the × close button is clicked. */\n onClose?: () => void;\n /** Show divider between header and body. Default: true. */\n headerDivider?: boolean;\n /** Optional control before close (Button, search field, …). */\n headerAction?: ReactNode;\n /**\n * Body inset. Default is 32px horizontal / 28px vertical. Use `menu` for\n * MenuItem lists. Use `none` when the host owns padding.\n */\n bodyPadding?: ModalBodyPadding;\n /**\n * When true (default), wraps body content in Scrollbar. Set false when the\n * host manages scroll inside panes.\n */\n scrollable?: boolean;\n /** Body content. */\n children: ReactNode;\n /** Footer slot — typically Buttons. Wrapped in `ModalFooter`. */\n footer?: ReactNode;\n /** Left footer slot (pagination status, PaginationDots, …). */\n footerLeading?: ReactNode;\n /** Footer layout. Figma Modal Footer Type. Default: `2-actions`. */\n footerType?: ModalFooterType;\n /** Show divider between body and footer. Default: true. */\n footerDivider?: boolean;\n}\n\n/**\n * Modal dialog shell — composes ModalHeader, scrollable body, and ModalFooter.\n * Host owns portal, overlay, focus trap, and open/close.\n */\nexport default function Modal({\n className = '',\n style,\n size = 'small',\n title,\n subtitle,\n subtitlePlacement = 'below',\n hideTitle = false,\n showBackButton = false,\n onBack,\n onClose,\n headerDivider = true,\n headerAction,\n bodyPadding = 'default',\n scrollable = true,\n children,\n footer,\n footerLeading,\n footerType = '2-actions',\n footerDivider = true,\n}: ModalProps) {\n const titleId = useId();\n const sizeClass = styles[`modal--size-${toKebab(size)}`];\n const bodyInnerClass = [\n styles['modal__body-inner'],\n bodyPadding === 'menu' && styles['modal__body-inner--menu'],\n bodyPadding === 'none' && styles['modal__body-inner--none'],\n ]\n .filter(Boolean)\n .join(' ');\n\n const bodyInner = <div className={bodyInnerClass}>{children}</div>;\n const showFooter =\n footer != null ||\n footerLeading != null ||\n footerType === 'spacer-small' ||\n footerType === 'spacer-large';\n\n return (\n <div\n className={[styles.modal, sizeClass, className].filter(Boolean).join(' ')}\n style={style}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n >\n <ModalHeader\n title={title}\n titleId={titleId}\n subtitle={subtitle}\n subtitlePlacement={subtitlePlacement}\n hideTitle={hideTitle}\n showBackButton={showBackButton}\n onBack={onBack}\n onClose={onClose}\n divider={headerDivider}\n headerAction={headerAction}\n />\n\n <div className={styles['modal__body']}>\n {scrollable ? <Scrollbar>{bodyInner}</Scrollbar> : bodyInner}\n </div>\n\n {showFooter && (\n <ModalFooter\n type={footerType}\n divider={footerDivider}\n leading={footerLeading}\n >\n {footer}\n </ModalFooter>\n )}\n </div>\n );\n}\n"],"names":["Modal","className","style","size","title","subtitle","subtitlePlacement","hideTitle","showBackButton","onBack","onClose","headerDivider","headerAction","bodyPadding","scrollable","children","footer","footerLeading","footerType","footerDivider","titleId","useId","sizeClass","styles","toKebab","bodyInnerClass","bodyInner","jsx","showFooter","jsxs","ModalHeader","Scrollbar","ModalFooter"],"mappings":";;;;;;;AA2EA,SAAwBA,EAAM;AAAA,EAC5B,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC,IAAoB;AAAA,EACpB,WAAAC,IAAY;AAAA,EACZ,gBAAAC,IAAiB;AAAA,EACjB,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,YAAAC,IAAa;AAAA,EACb,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,eAAAC,IAAgB;AAClB,GAAe;AACb,QAAMC,IAAUC,EAAA,GACVC,IAAYC,EAAO,eAAeC,EAAQrB,CAAI,CAAC,EAAE,GACjDsB,IAAiB;AAAA,IACrBF,EAAO,mBAAmB;AAAA,IAC1BV,MAAgB,UAAUU,EAAO,yBAAyB;AAAA,IAC1DV,MAAgB,UAAUU,EAAO,yBAAyB;AAAA,EAAA,EAEzD,OAAO,OAAO,EACd,KAAK,GAAG,GAELG,IAAY,gBAAAC,EAAC,OAAA,EAAI,WAAWF,GAAiB,UAAAV,GAAS,GACtDa,IACJZ,KAAU,QACVC,KAAiB,QACjBC,MAAe,kBACfA,MAAe;AAEjB,SACE,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,CAACN,EAAO,OAAOD,GAAWrB,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,MACxE,OAAAC;AAAA,MACA,MAAK;AAAA,MACL,cAAW;AAAA,MACX,mBAAiBkB;AAAA,MAEjB,UAAA;AAAA,QAAA,gBAAAO;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,OAAA1B;AAAA,YACA,SAAAgB;AAAA,YACA,UAAAf;AAAA,YACA,mBAAAC;AAAA,YACA,WAAAC;AAAA,YACA,gBAAAC;AAAA,YACA,QAAAC;AAAA,YACA,SAAAC;AAAA,YACA,SAASC;AAAA,YACT,cAAAC;AAAA,UAAA;AAAA,QAAA;AAAA,QAGF,gBAAAe,EAAC,OAAA,EAAI,WAAWJ,EAAO,aACpB,UAAAT,IAAa,gBAAAa,EAACI,GAAA,EAAW,UAAAL,EAAA,CAAU,IAAeA,GACrD;AAAA,QAECE,KACC,gBAAAD;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,MAAMd;AAAA,YACN,SAASC;AAAA,YACT,SAASF;AAAA,YAER,UAAAD;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._modal_18mtm_2{background-color:var(--center-channel-bg);border:1px solid rgba(var(--center-channel-color-rgb),.16);border-radius:var(--radius-l);box-shadow:var(--elevation-6);display:flex;flex-direction:column;overflow:hidden}._modal--size-small_18mtm_11{width:600px}._modal--size-medium_18mtm_14{width:704px}._modal--size-large_18mtm_17{width:832px}._modal__body_18mtm_20{flex:1;min-height:0}._modal__body-inner_18mtm_24{padding:28px var(--spacing-xxxl)}._modal__body-inner--menu_18mtm_27{padding:var(--spacing-xs) var(--spacing-l)}._modal__body-inner--none_18mtm_30{padding:0}._modal__body_18mtm_20>._modal__body-inner_18mtm_24{height:100%}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./Modal.module.css');const _="
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./Modal.module.css');const _="_modal_18mtm_2",m="_modal__body_18mtm_20",o={modal:_,"modal--size-small":"_modal--size-small_18mtm_11","modal--size-medium":"_modal--size-medium_18mtm_14","modal--size-large":"_modal--size-large_18mtm_17",modal__body:m,"modal__body-inner":"_modal__body-inner_18mtm_24","modal__body-inner--menu":"_modal__body-inner--menu_18mtm_27","modal__body-inner--none":"_modal__body-inner--none_18mtm_30"};exports.default=o;exports.modal=_;exports.modal__body=m;
|
|
2
2
|
//# sourceMappingURL=Modal.module.scss.cjs.map
|