@mattermost/compass-ui 0.1.0-alpha.14 → 0.1.0-alpha.16
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 +1 -1
- package/dist/components/action-button/ActionButton.cjs.map +1 -1
- package/dist/components/action-button/ActionButton.css +1 -1
- package/dist/components/action-button/ActionButton.d.ts +41 -5
- package/dist/components/action-button/ActionButton.d.ts.map +1 -1
- package/dist/components/action-button/ActionButton.js +68 -35
- package/dist/components/action-button/ActionButton.js.map +1 -1
- package/dist/components/action-button/ActionButton.module.scss.cjs +1 -1
- package/dist/components/action-button/ActionButton.module.scss.js +6 -5
- package/dist/components/action-button/ActionButton.module.scss.js.map +1 -1
- package/dist/components/action-button/index.d.ts +1 -1
- package/dist/components/action-button/index.d.ts.map +1 -1
- package/dist/components/admin-console-footer/AdminConsoleFooter.cjs +2 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.cjs.map +1 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.css +1 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.d.ts +27 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.d.ts.map +1 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.js +84 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.js.map +1 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.module.scss.cjs +2 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.module.scss.cjs.map +1 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.module.scss.js +13 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.module.scss.js.map +1 -0
- package/dist/components/admin-console-footer/index.cjs +2 -0
- package/dist/components/admin-console-footer/index.cjs.map +1 -0
- package/dist/components/admin-console-footer/index.d.ts +3 -0
- package/dist/components/admin-console-footer/index.d.ts.map +1 -0
- package/dist/components/admin-console-footer/index.js +5 -0
- package/dist/components/admin-console-footer/index.js.map +1 -0
- package/dist/components/admin-panel/AdminPanel.cjs +1 -1
- package/dist/components/admin-panel/AdminPanel.cjs.map +1 -1
- package/dist/components/admin-panel/AdminPanel.d.ts +41 -9
- package/dist/components/admin-panel/AdminPanel.d.ts.map +1 -1
- package/dist/components/admin-panel/AdminPanel.js +91 -81
- package/dist/components/admin-panel/AdminPanel.js.map +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.cjs +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.cjs.map +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.css +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.d.ts +18 -21
- package/dist/components/admin-panel-footer/AdminPanelFooter.d.ts.map +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.js +24 -61
- package/dist/components/admin-panel-footer/AdminPanelFooter.js.map +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.module.scss.cjs +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.module.scss.js +7 -9
- package/dist/components/admin-panel-footer/AdminPanelFooter.module.scss.js.map +1 -1
- package/dist/components/admin-panel-footer/index.d.ts +1 -1
- package/dist/components/admin-panel-footer/index.d.ts.map +1 -1
- package/dist/components/admin-panel-header/AdminPanelHeader.cjs.map +1 -1
- package/dist/components/admin-panel-header/AdminPanelHeader.d.ts +3 -2
- 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.css +1 -1
- package/dist/components/button/Button.d.ts +37 -6
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +106 -44
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/Button.module.scss.cjs +1 -1
- package/dist/components/button/Button.module.scss.js +16 -15
- package/dist/components/button/Button.module.scss.js.map +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button/index.d.ts.map +1 -1
- package/dist/components/channel-sidebar-item/ChannelSidebarItem.css +1 -1
- package/dist/components/channel-sidebar-item/ChannelSidebarItem.module.scss.cjs +1 -1
- package/dist/components/channel-sidebar-item/ChannelSidebarItem.module.scss.js +22 -22
- package/dist/components/checkbox/Checkbox.css +1 -1
- package/dist/components/checkbox/Checkbox.module.scss.cjs +1 -1
- package/dist/components/checkbox/Checkbox.module.scss.js +10 -10
- package/dist/components/chip/Chip.css +1 -1
- package/dist/components/chip/Chip.module.scss.cjs +1 -1
- package/dist/components/chip/Chip.module.scss.js +12 -12
- package/dist/components/combobox/Combobox.cjs +1 -1
- package/dist/components/combobox/Combobox.cjs.map +1 -1
- package/dist/components/combobox/Combobox.css +1 -1
- package/dist/components/combobox/Combobox.d.ts +14 -0
- package/dist/components/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.js +240 -224
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/combobox/Combobox.module.scss.cjs +1 -1
- package/dist/components/combobox/Combobox.module.scss.js +21 -21
- package/dist/components/icon-button/IconButton.cjs +1 -1
- package/dist/components/icon-button/IconButton.cjs.map +1 -1
- package/dist/components/icon-button/IconButton.css +1 -1
- package/dist/components/icon-button/IconButton.d.ts +48 -7
- package/dist/components/icon-button/IconButton.d.ts.map +1 -1
- package/dist/components/icon-button/IconButton.js +136 -62
- package/dist/components/icon-button/IconButton.js.map +1 -1
- package/dist/components/icon-button/IconButton.module.scss.cjs +1 -1
- package/dist/components/icon-button/IconButton.module.scss.js +16 -15
- package/dist/components/icon-button/IconButton.module.scss.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +1 -1
- package/dist/components/icon-button/index.d.ts.map +1 -1
- package/dist/components/menu-item/MenuItem.cjs.map +1 -1
- package/dist/components/menu-item/MenuItem.css +1 -1
- package/dist/components/menu-item/MenuItem.d.ts +20 -0
- package/dist/components/menu-item/MenuItem.d.ts.map +1 -1
- package/dist/components/menu-item/MenuItem.js.map +1 -1
- package/dist/components/menu-item/MenuItem.module.scss.cjs +1 -1
- package/dist/components/menu-item/MenuItem.module.scss.js +16 -16
- package/dist/components/menu-item/index.d.ts +1 -1
- package/dist/components/menu-item/index.d.ts.map +1 -1
- package/dist/components/radio/Radio.css +1 -1
- package/dist/components/radio/Radio.module.scss.cjs +1 -1
- package/dist/components/radio/Radio.module.scss.js +12 -12
- package/dist/components/right-sidebar-header/RightSidebarHeader.cjs +1 -1
- package/dist/components/right-sidebar-header/RightSidebarHeader.cjs.map +1 -1
- package/dist/components/right-sidebar-header/RightSidebarHeader.d.ts +5 -1
- package/dist/components/right-sidebar-header/RightSidebarHeader.d.ts.map +1 -1
- package/dist/components/right-sidebar-header/RightSidebarHeader.js +60 -48
- package/dist/components/right-sidebar-header/RightSidebarHeader.js.map +1 -1
- package/dist/components/section-notice/SectionNotice.cjs +1 -1
- package/dist/components/section-notice/SectionNotice.cjs.map +1 -1
- package/dist/components/section-notice/SectionNotice.css +1 -1
- package/dist/components/section-notice/SectionNotice.js +17 -17
- package/dist/components/section-notice/SectionNotice.js.map +1 -1
- package/dist/components/section-notice/SectionNotice.module.scss.cjs +1 -1
- package/dist/components/section-notice/SectionNotice.module.scss.js +12 -12
- package/dist/components/select/Select.cjs +1 -1
- package/dist/components/select/Select.cjs.map +1 -1
- package/dist/components/select/Select.css +1 -1
- package/dist/components/select/Select.d.ts +16 -0
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +177 -157
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/Select.module.scss.cjs +1 -1
- package/dist/components/select/Select.module.scss.js +20 -20
- package/dist/components/switch/Switch.css +1 -1
- package/dist/components/switch/Switch.module.scss.cjs +1 -1
- package/dist/components/switch/Switch.module.scss.js +9 -9
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +168 -166
- package/dist/index.js.map +1 -1
- package/dist/utils/menuItemProps.cjs +2 -0
- package/dist/utils/menuItemProps.cjs.map +1 -0
- package/dist/utils/menuItemProps.d.ts +5 -0
- package/dist/utils/menuItemProps.d.ts.map +1 -0
- package/dist/utils/menuItemProps.js +12 -0
- package/dist/utils/menuItemProps.js.map +1 -0
- package/dist/utils/slot.cjs +2 -0
- package/dist/utils/slot.cjs.map +1 -0
- package/dist/utils/slot.d.ts +46 -0
- package/dist/utils/slot.d.ts.map +1 -0
- package/dist/utils/slot.js +88 -0
- package/dist/utils/slot.js.map +1 -0
- package/package.json +5 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import './Radio.css';const _ = "
|
|
1
|
+
import './Radio.css';const _ = "_radio_h0rbb_2", i = "_radio__input_h0rbb_17", r = "_radio__circle_h0rbb_36", a = "_radio__dot_h0rbb_62", o = "_radio__label_h0rbb_119", d = {
|
|
2
2
|
radio: _,
|
|
3
|
-
radio__input:
|
|
4
|
-
radio__circle:
|
|
5
|
-
radio__dot:
|
|
6
|
-
"radio--invalid": "_radio--
|
|
3
|
+
radio__input: i,
|
|
4
|
+
radio__circle: r,
|
|
5
|
+
radio__dot: a,
|
|
6
|
+
"radio--invalid": "_radio--invalid_h0rbb_83",
|
|
7
7
|
radio__label: o,
|
|
8
|
-
"radio--size-small": "_radio--size-
|
|
9
|
-
"radio--size-medium": "_radio--size-
|
|
10
|
-
"radio--size-large": "_radio--size-
|
|
8
|
+
"radio--size-small": "_radio--size-small_h0rbb_122",
|
|
9
|
+
"radio--size-medium": "_radio--size-medium_h0rbb_143",
|
|
10
|
+
"radio--size-large": "_radio--size-large_h0rbb_164"
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
d as default,
|
|
14
14
|
_ as radio,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
r as radio__circle,
|
|
16
|
+
a as radio__dot,
|
|
17
|
+
i as radio__input,
|
|
18
18
|
o as radio__label
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=Radio.module.scss.js.map
|
|
@@ -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"),__z=require("@mattermost/compass-icons/components/arrow-back-ios.js"),z=__z?.default??__z,__C=require("@mattermost/compass-icons/components/arrow-collapse.js"),C=__C?.default??__C,__k=require("@mattermost/compass-icons/components/arrow-expand.js"),k=__k?.default??__k,__v=require("@mattermost/compass-icons/components/close.js"),v=__v?.default??__v,__w=require("@mattermost/compass-icons/components/dock-window.js"),w=__w?.default??__w,s=require("../icon/Icon.cjs"),r=require("../icon-button/IconButton.cjs"),I=require("../tag/Tag.cjs"),a=require("./RightSidebarHeader.module.scss.cjs");function B({title:j,secondaryTitle:i,tag:l,tagType:x="info",leadingIcon:d,onBack:t,backLabel:_="Back",onExpand:n,expanded:c=!1,expandLabel:b="Expand",collapseLabel:g="Collapse",onPopout:o,popoutLabel:m="Open in new window",onClose:u,closeLabel:p="Close",actionLabel:h,onActionClick:N,actionActive:f=!1,className:q=""}){const y=[a.default["right-sidebar-header"],q].filter(Boolean).join(" ");return e.jsxs("div",{className:y,children:[e.jsxs("div",{className:a.default["right-sidebar-header__left"],children:[e.jsxs("div",{className:a.default["right-sidebar-header__primary"],children:[t&&e.jsx(r.default,{className:a.default["right-sidebar-header__back"],size:"small","aria-label":_,onClick:t,icon:e.jsx(s.default,{size:"16",glyph:e.jsx(z,{})})}),d&&e.jsx("span",{className:a.default["right-sidebar-header__leading-icon"],children:d}),e.jsx("span",{className:a.default["right-sidebar-header__title"],children:j}),l&&e.jsx("span",{className:a.default["right-sidebar-header__tag"],children:e.jsx(I.default,{label:l,type:x,size:"x-small",casing:"all-caps"})})]}),i&&e.jsx("div",{className:a.default["right-sidebar-header__secondary"],children:e.jsx("span",{className:a.default["right-sidebar-header__secondary-text"],children:i})})]}),e.jsxs("div",{className:a.default["right-sidebar-header__actions"],children:[h&&e.jsx("button",{type:"button",className:[a.default["right-sidebar-header__action"],f?a.default["right-sidebar-header__action--active"]:""].filter(Boolean).join(" "),onClick:N,"aria-pressed":f?!0:void 0,children:h}),n&&e.jsx(r.default,{size:"small","aria-label":c?g:b,onClick:n,icon:e.jsx(s.default,{size:"16",glyph:c?e.jsx(C,{}):e.jsx(k,{})})}),o&&e.jsx(r.default,{size:"small","aria-label":m,onClick:o,icon:e.jsx(s.default,{size:"16",glyph:e.jsx(w,{})})}),u&&e.jsx(r.default,{size:"small","aria-label":p,onClick:u,icon:e.jsx(s.default,{size:"16",glyph:e.jsx(v,{})})})]})]})}exports.default=B;
|
|
2
2
|
//# sourceMappingURL=RightSidebarHeader.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RightSidebarHeader.cjs","sources":["../../../src/components/right-sidebar-header/RightSidebarHeader.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport ArrowBackIosIcon from '@mattermost/compass-icons/components/arrow-back-ios';\nimport ArrowCollapseIcon from '@mattermost/compass-icons/components/arrow-collapse';\nimport ArrowExpandIcon from '@mattermost/compass-icons/components/arrow-expand';\nimport CloseIcon from '@mattermost/compass-icons/components/close';\nimport Icon from '@/components/icon/Icon';\nimport IconButton from '@/components/icon-button/IconButton';\nimport Tag from '@/components/tag/Tag';\nimport type { TagType } from '@/components/tag/Tag';\nimport styles from './RightSidebarHeader.module.scss';\n\nexport interface RightSidebarHeaderProps {\n /** Primary title text. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n title: ReactNode;\n /** Secondary title shown to the right of a vertical divider (e.g. parent channel name). */\n secondaryTitle?: ReactNode;\n /** Optional tag rendered next to the title (e.g. \"BETA\"). */\n tag?: ReactNode;\n /** Tag visual style. Default: Info. */\n tagType?: TagType;\n /** Optional leading element shown before the title — typically a `UserAvatar` or an icon. When passing an icon, use `<Icon glyph={<SomeIcon />} size=\"20\" />` to align with the title text. */\n leadingIcon?: ReactNode;\n /** When set, shows a back button and calls this on click. */\n onBack?: () => void;\n /** Accessible name for the back button. Default: \"Back\". */\n backLabel?: string;\n /** When set, shows an expand/collapse button and calls this on click. */\n onExpand?: () => void;\n /** When true, the expand button shows the collapse icon. Requires `onExpand`. */\n expanded?: boolean;\n /** Accessible name for the expand button while collapsed. Default: \"Expand\". */\n expandLabel?: string;\n /** Accessible name for the expand button while expanded. Default: \"Collapse\". */\n collapseLabel?: string;\n /** When set, shows a close button and calls this on click. */\n onClose?: () => void;\n /** Accessible name for the close button. Default: \"Close\". */\n closeLabel?: string;\n /** Optional inline action label (e.g. \"Follow\"). Accepts translated nodes. */\n actionLabel?: ReactNode;\n /** Click handler for the action label. */\n onActionClick?: () => void;\n /** When true, the action button shows in its active state. */\n actionActive?: boolean;\n className?: string;\n}\n\nexport default function RightSidebarHeader({\n title,\n secondaryTitle,\n tag,\n tagType = 'info',\n leadingIcon,\n onBack,\n backLabel = 'Back',\n onExpand,\n expanded = false,\n expandLabel = 'Expand',\n collapseLabel = 'Collapse',\n onClose,\n closeLabel = 'Close',\n actionLabel,\n onActionClick,\n actionActive = false,\n className = '',\n}: RightSidebarHeaderProps) {\n const rootClass = [styles['right-sidebar-header'], className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={rootClass}>\n <div className={styles['right-sidebar-header__left']}>\n <div className={styles['right-sidebar-header__primary']}>\n {onBack && (\n <IconButton\n className={styles['right-sidebar-header__back']}\n size=\"small\"\n aria-label={backLabel}\n onClick={onBack}\n icon={<Icon size=\"16\" glyph={<ArrowBackIosIcon />} />}\n />\n )}\n {leadingIcon && (\n <span className={styles['right-sidebar-header__leading-icon']}>\n {leadingIcon}\n </span>\n )}\n <span className={styles['right-sidebar-header__title']}>{title}</span>\n {tag && (\n <span className={styles['right-sidebar-header__tag']}>\n <Tag\n label={tag}\n type={tagType}\n size=\"x-small\"\n casing=\"all-caps\"\n />\n </span>\n )}\n </div>\n {secondaryTitle && (\n <div className={styles['right-sidebar-header__secondary']}>\n <span className={styles['right-sidebar-header__secondary-text']}>\n {secondaryTitle}\n </span>\n </div>\n )}\n </div>\n\n <div className={styles['right-sidebar-header__actions']}>\n {actionLabel && (\n <button\n type=\"button\"\n className={[\n styles['right-sidebar-header__action'],\n actionActive\n ? styles['right-sidebar-header__action--active']\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={onActionClick}\n aria-pressed={actionActive ? true : undefined}\n >\n {actionLabel}\n </button>\n )}\n {onExpand && (\n <IconButton\n size=\"small\"\n aria-label={expanded ? collapseLabel : expandLabel}\n onClick={onExpand}\n icon={\n <Icon\n size=\"16\"\n glyph={expanded ? <ArrowCollapseIcon /> : <ArrowExpandIcon />}\n />\n }\n />\n )}\n {onClose && (\n <IconButton\n size=\"small\"\n aria-label={closeLabel}\n onClick={onClose}\n icon={<Icon size=\"16\" glyph={<CloseIcon />} />}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["RightSidebarHeader","title","secondaryTitle","tag","tagType","leadingIcon","onBack","backLabel","onExpand","expanded","expandLabel","collapseLabel","onClose","closeLabel","actionLabel","onActionClick","actionActive","className","rootClass","styles","jsxs","jsx","IconButton","Icon","ArrowBackIosIcon","Tag","ArrowCollapseIcon","ArrowExpandIcon","CloseIcon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"RightSidebarHeader.cjs","sources":["../../../src/components/right-sidebar-header/RightSidebarHeader.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport ArrowBackIosIcon from '@mattermost/compass-icons/components/arrow-back-ios';\nimport ArrowCollapseIcon from '@mattermost/compass-icons/components/arrow-collapse';\nimport ArrowExpandIcon from '@mattermost/compass-icons/components/arrow-expand';\nimport CloseIcon from '@mattermost/compass-icons/components/close';\nimport DockWindowIcon from '@mattermost/compass-icons/components/dock-window';\nimport Icon from '@/components/icon/Icon';\nimport IconButton from '@/components/icon-button/IconButton';\nimport Tag from '@/components/tag/Tag';\nimport type { TagType } from '@/components/tag/Tag';\nimport styles from './RightSidebarHeader.module.scss';\n\nexport interface RightSidebarHeaderProps {\n /** Primary title text. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n title: ReactNode;\n /** Secondary title shown to the right of a vertical divider (e.g. parent channel name). */\n secondaryTitle?: ReactNode;\n /** Optional tag rendered next to the title (e.g. \"BETA\"). */\n tag?: ReactNode;\n /** Tag visual style. Default: Info. */\n tagType?: TagType;\n /** Optional leading element shown before the title — typically a `UserAvatar` or an icon. When passing an icon, use `<Icon glyph={<SomeIcon />} size=\"20\" />` to align with the title text. */\n leadingIcon?: ReactNode;\n /** When set, shows a back button and calls this on click. */\n onBack?: () => void;\n /** Accessible name for the back button. Default: \"Back\". */\n backLabel?: string;\n /** When set, shows an expand/collapse button and calls this on click. */\n onExpand?: () => void;\n /** When true, the expand button shows the collapse icon. Requires `onExpand`. */\n expanded?: boolean;\n /** Accessible name for the expand button while collapsed. Default: \"Expand\". */\n expandLabel?: string;\n /** Accessible name for the expand button while expanded. Default: \"Collapse\". */\n collapseLabel?: string;\n /** When set, shows a pop out button (open in a new window) between expand and close, and calls this on click. */\n onPopout?: () => void;\n /** Accessible name for the pop out button. Default: \"Open in new window\". */\n popoutLabel?: string;\n /** When set, shows a close button and calls this on click. */\n onClose?: () => void;\n /** Accessible name for the close button. Default: \"Close\". */\n closeLabel?: string;\n /** Optional inline action label (e.g. \"Follow\"). Accepts translated nodes. */\n actionLabel?: ReactNode;\n /** Click handler for the action label. */\n onActionClick?: () => void;\n /** When true, the action button shows in its active state. */\n actionActive?: boolean;\n className?: string;\n}\n\nexport default function RightSidebarHeader({\n title,\n secondaryTitle,\n tag,\n tagType = 'info',\n leadingIcon,\n onBack,\n backLabel = 'Back',\n onExpand,\n expanded = false,\n expandLabel = 'Expand',\n collapseLabel = 'Collapse',\n onPopout,\n popoutLabel = 'Open in new window',\n onClose,\n closeLabel = 'Close',\n actionLabel,\n onActionClick,\n actionActive = false,\n className = '',\n}: RightSidebarHeaderProps) {\n const rootClass = [styles['right-sidebar-header'], className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={rootClass}>\n <div className={styles['right-sidebar-header__left']}>\n <div className={styles['right-sidebar-header__primary']}>\n {onBack && (\n <IconButton\n className={styles['right-sidebar-header__back']}\n size=\"small\"\n aria-label={backLabel}\n onClick={onBack}\n icon={<Icon size=\"16\" glyph={<ArrowBackIosIcon />} />}\n />\n )}\n {leadingIcon && (\n <span className={styles['right-sidebar-header__leading-icon']}>\n {leadingIcon}\n </span>\n )}\n <span className={styles['right-sidebar-header__title']}>{title}</span>\n {tag && (\n <span className={styles['right-sidebar-header__tag']}>\n <Tag\n label={tag}\n type={tagType}\n size=\"x-small\"\n casing=\"all-caps\"\n />\n </span>\n )}\n </div>\n {secondaryTitle && (\n <div className={styles['right-sidebar-header__secondary']}>\n <span className={styles['right-sidebar-header__secondary-text']}>\n {secondaryTitle}\n </span>\n </div>\n )}\n </div>\n\n <div className={styles['right-sidebar-header__actions']}>\n {actionLabel && (\n <button\n type=\"button\"\n className={[\n styles['right-sidebar-header__action'],\n actionActive\n ? styles['right-sidebar-header__action--active']\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={onActionClick}\n aria-pressed={actionActive ? true : undefined}\n >\n {actionLabel}\n </button>\n )}\n {onExpand && (\n <IconButton\n size=\"small\"\n aria-label={expanded ? collapseLabel : expandLabel}\n onClick={onExpand}\n icon={\n <Icon\n size=\"16\"\n glyph={expanded ? <ArrowCollapseIcon /> : <ArrowExpandIcon />}\n />\n }\n />\n )}\n {onPopout && (\n <IconButton\n size=\"small\"\n aria-label={popoutLabel}\n onClick={onPopout}\n icon={<Icon size=\"16\" glyph={<DockWindowIcon />} />}\n />\n )}\n {onClose && (\n <IconButton\n size=\"small\"\n aria-label={closeLabel}\n onClick={onClose}\n icon={<Icon size=\"16\" glyph={<CloseIcon />} />}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["RightSidebarHeader","title","secondaryTitle","tag","tagType","leadingIcon","onBack","backLabel","onExpand","expanded","expandLabel","collapseLabel","onPopout","popoutLabel","onClose","closeLabel","actionLabel","onActionClick","actionActive","className","rootClass","styles","jsxs","jsx","IconButton","Icon","ArrowBackIosIcon","Tag","ArrowCollapseIcon","ArrowExpandIcon","DockWindowIcon","CloseIcon"],"mappings":"8lBAoDA,SAAwBA,EAAmB,CACzC,MAAAC,EACA,eAAAC,EACA,IAAAC,EACA,QAAAC,EAAU,OACV,YAAAC,EACA,OAAAC,EACA,UAAAC,EAAY,OACZ,SAAAC,EACA,SAAAC,EAAW,GACX,YAAAC,EAAc,SACd,cAAAC,EAAgB,WAChB,SAAAC,EACA,YAAAC,EAAc,qBACd,QAAAC,EACA,WAAAC,EAAa,QACb,YAAAC,EACA,cAAAC,EACA,aAAAC,EAAe,GACf,UAAAC,EAAY,EACd,EAA4B,CAC1B,MAAMC,EAAY,CAACC,UAAO,sBAAsB,EAAGF,CAAS,EACzD,OAAO,OAAO,EACd,KAAK,GAAG,EAEX,OACEG,EAAAA,KAAC,MAAA,CAAI,UAAWF,EACd,SAAA,CAAAE,EAAAA,KAAC,MAAA,CAAI,UAAWD,EAAAA,QAAO,4BAA4B,EACjD,SAAA,CAAAC,EAAAA,KAAC,MAAA,CAAI,UAAWD,EAAAA,QAAO,+BAA+B,EACnD,SAAA,CAAAf,GACCiB,EAAAA,IAACC,EAAAA,QAAA,CACC,UAAWH,EAAAA,QAAO,4BAA4B,EAC9C,KAAK,QACL,aAAYd,EACZ,QAASD,EACT,WAAOmB,EAAAA,QAAA,CAAK,KAAK,KAAK,MAAOF,EAAAA,IAACG,IAAiB,CAAA,CAAI,CAAA,CAAA,EAGtDrB,GACCkB,EAAAA,IAAC,OAAA,CAAK,UAAWF,EAAAA,QAAO,oCAAoC,EACzD,SAAAhB,EACH,QAED,OAAA,CAAK,UAAWgB,EAAAA,QAAO,6BAA6B,EAAI,SAAApB,EAAM,EAC9DE,GACCoB,EAAAA,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EJ,CAAA,EACF,CAEJ"}
|
|
@@ -23,6 +23,10 @@ export interface RightSidebarHeaderProps {
|
|
|
23
23
|
expandLabel?: string;
|
|
24
24
|
/** Accessible name for the expand button while expanded. Default: "Collapse". */
|
|
25
25
|
collapseLabel?: string;
|
|
26
|
+
/** When set, shows a pop out button (open in a new window) between expand and close, and calls this on click. */
|
|
27
|
+
onPopout?: () => void;
|
|
28
|
+
/** Accessible name for the pop out button. Default: "Open in new window". */
|
|
29
|
+
popoutLabel?: string;
|
|
26
30
|
/** When set, shows a close button and calls this on click. */
|
|
27
31
|
onClose?: () => void;
|
|
28
32
|
/** Accessible name for the close button. Default: "Close". */
|
|
@@ -35,5 +39,5 @@ export interface RightSidebarHeaderProps {
|
|
|
35
39
|
actionActive?: boolean;
|
|
36
40
|
className?: string;
|
|
37
41
|
}
|
|
38
|
-
export default function RightSidebarHeader({ title, secondaryTitle, tag, tagType, leadingIcon, onBack, backLabel, onExpand, expanded, expandLabel, collapseLabel, onClose, closeLabel, actionLabel, onActionClick, actionActive, className, }: RightSidebarHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export default function RightSidebarHeader({ title, secondaryTitle, tag, tagType, leadingIcon, onBack, backLabel, onExpand, expanded, expandLabel, collapseLabel, onPopout, popoutLabel, onClose, closeLabel, actionLabel, onActionClick, actionActive, className, }: RightSidebarHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
39
43
|
//# sourceMappingURL=RightSidebarHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RightSidebarHeader.d.ts","sourceRoot":"","sources":["../../../src/components/right-sidebar-header/RightSidebarHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RightSidebarHeader.d.ts","sourceRoot":"","sources":["../../../src/components/right-sidebar-header/RightSidebarHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,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SAAkB,EAClB,QAAQ,EACR,QAAgB,EAChB,WAAsB,EACtB,aAA0B,EAC1B,QAAQ,EACR,WAAkC,EAClC,OAAO,EACP,UAAoB,EACpB,WAAW,EACX,aAAa,EACb,YAAoB,EACpB,SAAc,GACf,EAAE,uBAAuB,2CA8FzB"}
|
|
@@ -1,84 +1,87 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import __u from "@mattermost/compass-icons/components/arrow-back-ios.js";const u=__u&&__u.default?__u.default:__u;
|
|
3
3
|
import __v from "@mattermost/compass-icons/components/arrow-collapse.js";const v=__v&&__v.default?__v.default:__v;
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import __x from "@mattermost/compass-icons/components/arrow-expand.js";const x=__x&&__x.default?__x.default:__x;
|
|
5
|
+
import __j from "@mattermost/compass-icons/components/close.js";const j=__j&&__j.default?__j.default:__j;
|
|
6
|
+
import __B from "@mattermost/compass-icons/components/dock-window.js";const B=__B&&__B.default?__B.default:__B;
|
|
6
7
|
import i from "../icon/Icon.js";
|
|
7
8
|
import s from "../icon-button/IconButton.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
function
|
|
11
|
-
title:
|
|
9
|
+
import A from "../tag/Tag.js";
|
|
10
|
+
import a from "./RightSidebarHeader.module.scss.js";
|
|
11
|
+
function J({
|
|
12
|
+
title: b,
|
|
12
13
|
secondaryTitle: l,
|
|
13
14
|
tag: o,
|
|
14
|
-
tagType:
|
|
15
|
-
leadingIcon:
|
|
15
|
+
tagType: g = "info",
|
|
16
|
+
leadingIcon: c,
|
|
16
17
|
onBack: d,
|
|
17
|
-
backLabel:
|
|
18
|
-
onExpand:
|
|
19
|
-
expanded:
|
|
20
|
-
expandLabel:
|
|
21
|
-
collapseLabel:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
backLabel: f = "Back",
|
|
19
|
+
onExpand: n,
|
|
20
|
+
expanded: t = !1,
|
|
21
|
+
expandLabel: N = "Expand",
|
|
22
|
+
collapseLabel: y = "Collapse",
|
|
23
|
+
onPopout: h,
|
|
24
|
+
popoutLabel: z = "Open in new window",
|
|
25
|
+
onClose: m,
|
|
26
|
+
closeLabel: C = "Close",
|
|
27
|
+
actionLabel: p,
|
|
28
|
+
onActionClick: k,
|
|
29
|
+
actionActive: _ = !1,
|
|
30
|
+
className: w = ""
|
|
28
31
|
}) {
|
|
29
|
-
const
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
32
|
+
const I = [a["right-sidebar-header"], w].filter(Boolean).join(" ");
|
|
33
|
+
return /* @__PURE__ */ r("div", { className: I, children: [
|
|
34
|
+
/* @__PURE__ */ r("div", { className: a["right-sidebar-header__left"], children: [
|
|
35
|
+
/* @__PURE__ */ r("div", { className: a["right-sidebar-header__primary"], children: [
|
|
33
36
|
d && /* @__PURE__ */ e(
|
|
34
37
|
s,
|
|
35
38
|
{
|
|
36
|
-
className:
|
|
39
|
+
className: a["right-sidebar-header__back"],
|
|
37
40
|
size: "small",
|
|
38
|
-
"aria-label":
|
|
41
|
+
"aria-label": f,
|
|
39
42
|
onClick: d,
|
|
40
|
-
icon: /* @__PURE__ */ e(i, { size: "16", glyph: /* @__PURE__ */ e(
|
|
43
|
+
icon: /* @__PURE__ */ e(i, { size: "16", glyph: /* @__PURE__ */ e(u, {}) })
|
|
41
44
|
}
|
|
42
45
|
),
|
|
43
|
-
|
|
44
|
-
/* @__PURE__ */ e("span", { className:
|
|
45
|
-
o && /* @__PURE__ */ e("span", { className:
|
|
46
|
-
|
|
46
|
+
c && /* @__PURE__ */ e("span", { className: a["right-sidebar-header__leading-icon"], children: c }),
|
|
47
|
+
/* @__PURE__ */ e("span", { className: a["right-sidebar-header__title"], children: b }),
|
|
48
|
+
o && /* @__PURE__ */ e("span", { className: a["right-sidebar-header__tag"], children: /* @__PURE__ */ e(
|
|
49
|
+
A,
|
|
47
50
|
{
|
|
48
51
|
label: o,
|
|
49
|
-
type:
|
|
52
|
+
type: g,
|
|
50
53
|
size: "x-small",
|
|
51
54
|
casing: "all-caps"
|
|
52
55
|
}
|
|
53
56
|
) })
|
|
54
57
|
] }),
|
|
55
|
-
l && /* @__PURE__ */ e("div", { className:
|
|
58
|
+
l && /* @__PURE__ */ e("div", { className: a["right-sidebar-header__secondary"], children: /* @__PURE__ */ e("span", { className: a["right-sidebar-header__secondary-text"], children: l }) })
|
|
56
59
|
] }),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
60
|
+
/* @__PURE__ */ r("div", { className: a["right-sidebar-header__actions"], children: [
|
|
61
|
+
p && /* @__PURE__ */ e(
|
|
59
62
|
"button",
|
|
60
63
|
{
|
|
61
64
|
type: "button",
|
|
62
65
|
className: [
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
a["right-sidebar-header__action"],
|
|
67
|
+
_ ? a["right-sidebar-header__action--active"] : ""
|
|
65
68
|
].filter(Boolean).join(" "),
|
|
66
|
-
onClick:
|
|
67
|
-
"aria-pressed":
|
|
68
|
-
children:
|
|
69
|
+
onClick: k,
|
|
70
|
+
"aria-pressed": _ ? !0 : void 0,
|
|
71
|
+
children: p
|
|
69
72
|
}
|
|
70
73
|
),
|
|
71
|
-
|
|
74
|
+
n && /* @__PURE__ */ e(
|
|
72
75
|
s,
|
|
73
76
|
{
|
|
74
77
|
size: "small",
|
|
75
|
-
"aria-label":
|
|
76
|
-
onClick:
|
|
78
|
+
"aria-label": t ? y : N,
|
|
79
|
+
onClick: n,
|
|
77
80
|
icon: /* @__PURE__ */ e(
|
|
78
81
|
i,
|
|
79
82
|
{
|
|
80
83
|
size: "16",
|
|
81
|
-
glyph:
|
|
84
|
+
glyph: t ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(x, {})
|
|
82
85
|
}
|
|
83
86
|
)
|
|
84
87
|
}
|
|
@@ -87,15 +90,24 @@ function F({
|
|
|
87
90
|
s,
|
|
88
91
|
{
|
|
89
92
|
size: "small",
|
|
90
|
-
"aria-label":
|
|
93
|
+
"aria-label": z,
|
|
91
94
|
onClick: h,
|
|
92
|
-
icon: /* @__PURE__ */ e(i, { size: "16", glyph: /* @__PURE__ */ e(
|
|
95
|
+
icon: /* @__PURE__ */ e(i, { size: "16", glyph: /* @__PURE__ */ e(B, {}) })
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
m && /* @__PURE__ */ e(
|
|
99
|
+
s,
|
|
100
|
+
{
|
|
101
|
+
size: "small",
|
|
102
|
+
"aria-label": C,
|
|
103
|
+
onClick: m,
|
|
104
|
+
icon: /* @__PURE__ */ e(i, { size: "16", glyph: /* @__PURE__ */ e(j, {}) })
|
|
93
105
|
}
|
|
94
106
|
)
|
|
95
107
|
] })
|
|
96
108
|
] });
|
|
97
109
|
}
|
|
98
110
|
export {
|
|
99
|
-
|
|
111
|
+
J as default
|
|
100
112
|
};
|
|
101
113
|
//# sourceMappingURL=RightSidebarHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RightSidebarHeader.js","sources":["../../../src/components/right-sidebar-header/RightSidebarHeader.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport ArrowBackIosIcon from '@mattermost/compass-icons/components/arrow-back-ios';\nimport ArrowCollapseIcon from '@mattermost/compass-icons/components/arrow-collapse';\nimport ArrowExpandIcon from '@mattermost/compass-icons/components/arrow-expand';\nimport CloseIcon from '@mattermost/compass-icons/components/close';\nimport Icon from '@/components/icon/Icon';\nimport IconButton from '@/components/icon-button/IconButton';\nimport Tag from '@/components/tag/Tag';\nimport type { TagType } from '@/components/tag/Tag';\nimport styles from './RightSidebarHeader.module.scss';\n\nexport interface RightSidebarHeaderProps {\n /** Primary title text. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n title: ReactNode;\n /** Secondary title shown to the right of a vertical divider (e.g. parent channel name). */\n secondaryTitle?: ReactNode;\n /** Optional tag rendered next to the title (e.g. \"BETA\"). */\n tag?: ReactNode;\n /** Tag visual style. Default: Info. */\n tagType?: TagType;\n /** Optional leading element shown before the title — typically a `UserAvatar` or an icon. When passing an icon, use `<Icon glyph={<SomeIcon />} size=\"20\" />` to align with the title text. */\n leadingIcon?: ReactNode;\n /** When set, shows a back button and calls this on click. */\n onBack?: () => void;\n /** Accessible name for the back button. Default: \"Back\". */\n backLabel?: string;\n /** When set, shows an expand/collapse button and calls this on click. */\n onExpand?: () => void;\n /** When true, the expand button shows the collapse icon. Requires `onExpand`. */\n expanded?: boolean;\n /** Accessible name for the expand button while collapsed. Default: \"Expand\". */\n expandLabel?: string;\n /** Accessible name for the expand button while expanded. Default: \"Collapse\". */\n collapseLabel?: string;\n /** When set, shows a close button and calls this on click. */\n onClose?: () => void;\n /** Accessible name for the close button. Default: \"Close\". */\n closeLabel?: string;\n /** Optional inline action label (e.g. \"Follow\"). Accepts translated nodes. */\n actionLabel?: ReactNode;\n /** Click handler for the action label. */\n onActionClick?: () => void;\n /** When true, the action button shows in its active state. */\n actionActive?: boolean;\n className?: string;\n}\n\nexport default function RightSidebarHeader({\n title,\n secondaryTitle,\n tag,\n tagType = 'info',\n leadingIcon,\n onBack,\n backLabel = 'Back',\n onExpand,\n expanded = false,\n expandLabel = 'Expand',\n collapseLabel = 'Collapse',\n onClose,\n closeLabel = 'Close',\n actionLabel,\n onActionClick,\n actionActive = false,\n className = '',\n}: RightSidebarHeaderProps) {\n const rootClass = [styles['right-sidebar-header'], className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={rootClass}>\n <div className={styles['right-sidebar-header__left']}>\n <div className={styles['right-sidebar-header__primary']}>\n {onBack && (\n <IconButton\n className={styles['right-sidebar-header__back']}\n size=\"small\"\n aria-label={backLabel}\n onClick={onBack}\n icon={<Icon size=\"16\" glyph={<ArrowBackIosIcon />} />}\n />\n )}\n {leadingIcon && (\n <span className={styles['right-sidebar-header__leading-icon']}>\n {leadingIcon}\n </span>\n )}\n <span className={styles['right-sidebar-header__title']}>{title}</span>\n {tag && (\n <span className={styles['right-sidebar-header__tag']}>\n <Tag\n label={tag}\n type={tagType}\n size=\"x-small\"\n casing=\"all-caps\"\n />\n </span>\n )}\n </div>\n {secondaryTitle && (\n <div className={styles['right-sidebar-header__secondary']}>\n <span className={styles['right-sidebar-header__secondary-text']}>\n {secondaryTitle}\n </span>\n </div>\n )}\n </div>\n\n <div className={styles['right-sidebar-header__actions']}>\n {actionLabel && (\n <button\n type=\"button\"\n className={[\n styles['right-sidebar-header__action'],\n actionActive\n ? styles['right-sidebar-header__action--active']\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={onActionClick}\n aria-pressed={actionActive ? true : undefined}\n >\n {actionLabel}\n </button>\n )}\n {onExpand && (\n <IconButton\n size=\"small\"\n aria-label={expanded ? collapseLabel : expandLabel}\n onClick={onExpand}\n icon={\n <Icon\n size=\"16\"\n glyph={expanded ? <ArrowCollapseIcon /> : <ArrowExpandIcon />}\n />\n }\n />\n )}\n {onClose && (\n <IconButton\n size=\"small\"\n aria-label={closeLabel}\n onClick={onClose}\n icon={<Icon size=\"16\" glyph={<CloseIcon />} />}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["RightSidebarHeader","title","secondaryTitle","tag","tagType","leadingIcon","onBack","backLabel","onExpand","expanded","expandLabel","collapseLabel","onClose","closeLabel","actionLabel","onActionClick","actionActive","className","rootClass","styles","jsxs","jsx","IconButton","Icon","ArrowBackIosIcon","Tag","ArrowCollapseIcon","ArrowExpandIcon","CloseIcon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"RightSidebarHeader.js","sources":["../../../src/components/right-sidebar-header/RightSidebarHeader.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport ArrowBackIosIcon from '@mattermost/compass-icons/components/arrow-back-ios';\nimport ArrowCollapseIcon from '@mattermost/compass-icons/components/arrow-collapse';\nimport ArrowExpandIcon from '@mattermost/compass-icons/components/arrow-expand';\nimport CloseIcon from '@mattermost/compass-icons/components/close';\nimport DockWindowIcon from '@mattermost/compass-icons/components/dock-window';\nimport Icon from '@/components/icon/Icon';\nimport IconButton from '@/components/icon-button/IconButton';\nimport Tag from '@/components/tag/Tag';\nimport type { TagType } from '@/components/tag/Tag';\nimport styles from './RightSidebarHeader.module.scss';\n\nexport interface RightSidebarHeaderProps {\n /** Primary title text. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n title: ReactNode;\n /** Secondary title shown to the right of a vertical divider (e.g. parent channel name). */\n secondaryTitle?: ReactNode;\n /** Optional tag rendered next to the title (e.g. \"BETA\"). */\n tag?: ReactNode;\n /** Tag visual style. Default: Info. */\n tagType?: TagType;\n /** Optional leading element shown before the title — typically a `UserAvatar` or an icon. When passing an icon, use `<Icon glyph={<SomeIcon />} size=\"20\" />` to align with the title text. */\n leadingIcon?: ReactNode;\n /** When set, shows a back button and calls this on click. */\n onBack?: () => void;\n /** Accessible name for the back button. Default: \"Back\". */\n backLabel?: string;\n /** When set, shows an expand/collapse button and calls this on click. */\n onExpand?: () => void;\n /** When true, the expand button shows the collapse icon. Requires `onExpand`. */\n expanded?: boolean;\n /** Accessible name for the expand button while collapsed. Default: \"Expand\". */\n expandLabel?: string;\n /** Accessible name for the expand button while expanded. Default: \"Collapse\". */\n collapseLabel?: string;\n /** When set, shows a pop out button (open in a new window) between expand and close, and calls this on click. */\n onPopout?: () => void;\n /** Accessible name for the pop out button. Default: \"Open in new window\". */\n popoutLabel?: string;\n /** When set, shows a close button and calls this on click. */\n onClose?: () => void;\n /** Accessible name for the close button. Default: \"Close\". */\n closeLabel?: string;\n /** Optional inline action label (e.g. \"Follow\"). Accepts translated nodes. */\n actionLabel?: ReactNode;\n /** Click handler for the action label. */\n onActionClick?: () => void;\n /** When true, the action button shows in its active state. */\n actionActive?: boolean;\n className?: string;\n}\n\nexport default function RightSidebarHeader({\n title,\n secondaryTitle,\n tag,\n tagType = 'info',\n leadingIcon,\n onBack,\n backLabel = 'Back',\n onExpand,\n expanded = false,\n expandLabel = 'Expand',\n collapseLabel = 'Collapse',\n onPopout,\n popoutLabel = 'Open in new window',\n onClose,\n closeLabel = 'Close',\n actionLabel,\n onActionClick,\n actionActive = false,\n className = '',\n}: RightSidebarHeaderProps) {\n const rootClass = [styles['right-sidebar-header'], className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={rootClass}>\n <div className={styles['right-sidebar-header__left']}>\n <div className={styles['right-sidebar-header__primary']}>\n {onBack && (\n <IconButton\n className={styles['right-sidebar-header__back']}\n size=\"small\"\n aria-label={backLabel}\n onClick={onBack}\n icon={<Icon size=\"16\" glyph={<ArrowBackIosIcon />} />}\n />\n )}\n {leadingIcon && (\n <span className={styles['right-sidebar-header__leading-icon']}>\n {leadingIcon}\n </span>\n )}\n <span className={styles['right-sidebar-header__title']}>{title}</span>\n {tag && (\n <span className={styles['right-sidebar-header__tag']}>\n <Tag\n label={tag}\n type={tagType}\n size=\"x-small\"\n casing=\"all-caps\"\n />\n </span>\n )}\n </div>\n {secondaryTitle && (\n <div className={styles['right-sidebar-header__secondary']}>\n <span className={styles['right-sidebar-header__secondary-text']}>\n {secondaryTitle}\n </span>\n </div>\n )}\n </div>\n\n <div className={styles['right-sidebar-header__actions']}>\n {actionLabel && (\n <button\n type=\"button\"\n className={[\n styles['right-sidebar-header__action'],\n actionActive\n ? styles['right-sidebar-header__action--active']\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={onActionClick}\n aria-pressed={actionActive ? true : undefined}\n >\n {actionLabel}\n </button>\n )}\n {onExpand && (\n <IconButton\n size=\"small\"\n aria-label={expanded ? collapseLabel : expandLabel}\n onClick={onExpand}\n icon={\n <Icon\n size=\"16\"\n glyph={expanded ? <ArrowCollapseIcon /> : <ArrowExpandIcon />}\n />\n }\n />\n )}\n {onPopout && (\n <IconButton\n size=\"small\"\n aria-label={popoutLabel}\n onClick={onPopout}\n icon={<Icon size=\"16\" glyph={<DockWindowIcon />} />}\n />\n )}\n {onClose && (\n <IconButton\n size=\"small\"\n aria-label={closeLabel}\n onClick={onClose}\n icon={<Icon size=\"16\" glyph={<CloseIcon />} />}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["RightSidebarHeader","title","secondaryTitle","tag","tagType","leadingIcon","onBack","backLabel","onExpand","expanded","expandLabel","collapseLabel","onPopout","popoutLabel","onClose","closeLabel","actionLabel","onActionClick","actionActive","className","rootClass","styles","jsxs","jsx","IconButton","Icon","ArrowBackIosIcon","Tag","ArrowCollapseIcon","ArrowExpandIcon","DockWindowIcon","CloseIcon"],"mappings":";;;;;;;;;;AAoDA,SAAwBA,EAAmB;AAAA,EACzC,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,KAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,aAAAC,IAAc;AAAA,EACd,eAAAC,IAAgB;AAAA,EAChB,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,SAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,WAAAC,IAAY;AACd,GAA4B;AAC1B,QAAMC,IAAY,CAACC,EAAO,sBAAsB,GAAGF,CAAS,EACzD,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,gBAAAG,EAAC,OAAA,EAAI,WAAWF,GACd,UAAA;AAAA,IAAA,gBAAAE,EAAC,OAAA,EAAI,WAAWD,EAAO,4BAA4B,GACjD,UAAA;AAAA,MAAA,gBAAAC,EAAC,OAAA,EAAI,WAAWD,EAAO,+BAA+B,GACnD,UAAA;AAAA,QAAAf,KACC,gBAAAiB;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,WAAWH,EAAO,4BAA4B;AAAA,YAC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E;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,OAAOhB,IAAW,gBAAAc,EAACK,GAAA,CAAA,CAAkB,sBAAMC,GAAA,CAAA,CAAgB;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7D;AAAA,MAAA;AAAA,MAILjB,KACC,gBAAAW;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,cAAYX;AAAA,UACZ,SAASD;AAAA,UACT,wBAAOa,GAAA,EAAK,MAAK,MAAK,OAAO,gBAAAF,EAACO,KAAe,EAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,MAGpDhB,KACC,gBAAAS;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,cAAYT;AAAA,UACZ,SAASD;AAAA,UACT,wBAAOW,GAAA,EAAK,MAAK,MAAK,OAAO,gBAAAF,EAACQ,KAAU,EAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IAC9C,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),d=require("../button/Button.cjs"),y=require("../icon-button/IconButton.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),d=require("../button/Button.cjs"),y=require("../icon-button/IconButton.cjs"),s=require("../icon/Icon.cjs"),__j=require("@mattermost/compass-icons/components/information-outline.js"),j=__j?.default??__j,__O=require("@mattermost/compass-icons/components/alert-outline.js"),O=__O?.default??__O,__S=require("@mattermost/compass-icons/components/alert-circle-outline.js"),S=__S?.default??__S,__k=require("@mattermost/compass-icons/components/check-circle-outline.js"),k=__k?.default??__k,__A=require("@mattermost/compass-icons/components/close.js"),A=__A?.default??__A,b=require("../../utils/props.cjs"),l=require("./SectionNotice.module.scss.cjs"),w={info:e.jsx(s.default,{size:"20",glyph:e.jsx(j,{})}),warning:e.jsx(s.default,{size:"20",glyph:e.jsx(S,{})}),danger:e.jsx(s.default,{size:"20",glyph:e.jsx(O,{})}),success:e.jsx(s.default,{size:"20",glyph:e.jsx(k,{})}),hint:e.jsx(s.default,{size:"20",glyph:e.jsx(j,{})})};function M({className:f="",type:t="info",icon:o,title:x,description:a,primaryButtonLabel:n,onPrimaryAction:h,secondaryButtonLabel:c,onSecondaryAction:_,primaryActionDisabled:m,primaryActionLoading:g,secondaryActionDisabled:C,secondaryActionLoading:N,onDismiss:r,dismissLabel:q="Dismiss",dismissButtonProps:i,...v}){const I=l.default[`section-notice--type-${t.toLowerCase()}`],z=[l.default["section-notice"],I,f].filter(Boolean).join(" "),u=o!==void 0?o:w[t],p=n!=null||c!=null;return e.jsxs("div",{...v,className:z,children:[e.jsxs("div",{className:l.default["section-notice__content"],children:[u!=null&&e.jsx("span",{className:l.default["section-notice__icon"],"aria-hidden":!0,children:e.jsx(s.IconSlotContext.Provider,{value:{size:"20"},children:u})}),e.jsxs("div",{className:l.default["section-notice__body"],children:[e.jsx("h4",{className:l.default["section-notice__title"],children:x}),a!=null&&e.jsx("div",{className:l.default["section-notice__description"],children:a}),p&&e.jsxs("div",{className:l.default["section-notice__actions"],children:[n!=null&&e.jsx(d.default,{emphasis:"primary",size:"small",disabled:m,loading:g,onClick:h,children:n}),c!=null&&e.jsx(d.default,{emphasis:"tertiary",size:"small",disabled:C,loading:N,onClick:_,children:c})]})]})]}),r!=null&&e.jsx(y.default,{...i,className:b.mergeClassNames(l.default["section-notice__dismiss"],i==null?void 0:i.className),"aria-label":q,size:"small",icon:e.jsx(s.default,{size:"16",glyph:e.jsx(A,{})}),onClick:r})]})}exports.default=M;
|
|
2
2
|
//# sourceMappingURL=SectionNotice.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionNotice.cjs","sources":["../../../src/components/section-notice/SectionNotice.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\nimport Button from '@/components/button/Button';\nimport IconButton from '@/components/icon-button/IconButton';\nimport Icon from '@/components/icon/Icon';\nimport { IconSlotContext } from '@/components/icon/Icon';\nimport InformationOutlineIcon from '@mattermost/compass-icons/components/information-outline';\nimport AlertOutlineIcon from '@mattermost/compass-icons/components/alert-outline';\nimport AlertCircleOutlineIcon from '@mattermost/compass-icons/components/alert-circle-outline';\nimport CheckCircleOutlineIcon from '@mattermost/compass-icons/components/check-circle-outline';\nimport CloseIcon from '@mattermost/compass-icons/components/close';\nimport type { BuiltInButtonProps } from '@/utils/props';\nimport { mergeClassNames } from '@/utils/props';\nimport styles from './SectionNotice.module.scss';\n\nexport type SectionNoticeType =\n | 'info'\n | 'warning'\n | 'danger'\n | 'success'\n | 'hint';\n\nexport interface SectionNoticeProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /** Optional CSS class name. */\n className?: string;\n /** Type controls color-coding. Default: Info. */\n type?: SectionNoticeType;\n /** Optional leading icon. When omitted a default type icon is shown. Pass `<Icon glyph={<SomeIcon />} />` — SectionNotice provides the correct size via context. */\n icon?: ReactNode;\n /** Title / headline. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n title: ReactNode;\n /** Optional body description. */\n description?: ReactNode;\n /** Primary action button label. */\n primaryButtonLabel?: ReactNode;\n /** Primary action callback. */\n onPrimaryAction?: () => void;\n /** Disables the primary action button. */\n primaryActionDisabled?: boolean;\n /** Shows a spinner in the primary action button and disables it. */\n primaryActionLoading?: boolean;\n /** Secondary action button label. */\n secondaryButtonLabel?: ReactNode;\n /** Secondary action callback. */\n onSecondaryAction?: () => void;\n /** Disables the secondary action button. */\n secondaryActionDisabled?: boolean;\n /** Shows a spinner in the secondary action button and disables it. */\n secondaryActionLoading?: boolean;\n /** Called when dismiss (×) button is clicked. When omitted, dismiss button is hidden. */\n onDismiss?: () => void;\n /** Accessible name for the dismiss button. Default: \"Dismiss\". */\n dismissLabel?: string;\n /** Extra attributes for the dismiss button (e.g. `data-testid`). */\n dismissButtonProps?: BuiltInButtonProps;\n}\n\nconst DEFAULT_ICONS: Record<SectionNoticeType, ReactNode> = {\n info: <Icon size=\"20\" glyph={<InformationOutlineIcon />} />,\n warning: <Icon size=\"20\" glyph={<AlertCircleOutlineIcon />} />,\n danger: <Icon size=\"20\" glyph={<AlertOutlineIcon />} />,\n success: <Icon size=\"20\" glyph={<CheckCircleOutlineIcon />} />,\n hint: <Icon size=\"20\" glyph={<InformationOutlineIcon />} />,\n};\n\n/**\n * A Section Notice is an in-context alert that lives inside a settings page, admin panel, or\n * other content region. Use it to flag important information, report a state change, or\n * surface a problem the user needs to act on — without yanking them out of the flow.\n */\nexport default function SectionNotice({\n className = '',\n type = 'info',\n icon,\n title,\n description,\n primaryButtonLabel,\n onPrimaryAction,\n secondaryButtonLabel,\n onSecondaryAction,\n primaryActionDisabled,\n primaryActionLoading,\n secondaryActionDisabled,\n secondaryActionLoading,\n onDismiss,\n dismissLabel = 'Dismiss',\n dismissButtonProps,\n ...rest\n}: SectionNoticeProps) {\n const typeClass = styles[`section-notice--type-${type.toLowerCase()}`];\n\n const rootClass = [styles['section-notice'], typeClass, className]\n .filter(Boolean)\n .join(' ');\n\n const resolvedIcon = icon !== undefined ? icon : DEFAULT_ICONS[type];\n\n const hasActions = primaryButtonLabel != null || secondaryButtonLabel != null;\n\n return (\n <div {...rest} className={rootClass}>\n <div className={styles['section-notice__content']}>\n {resolvedIcon != null && (\n <span className={styles['section-notice__icon']} aria-hidden>\n <IconSlotContext.Provider value={{ size: '20' }}>\n {resolvedIcon}\n </IconSlotContext.Provider>\n </span>\n )}\n <div className={styles['section-notice__body']}>\n <
|
|
1
|
+
{"version":3,"file":"SectionNotice.cjs","sources":["../../../src/components/section-notice/SectionNotice.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\nimport Button from '@/components/button/Button';\nimport IconButton from '@/components/icon-button/IconButton';\nimport Icon from '@/components/icon/Icon';\nimport { IconSlotContext } from '@/components/icon/Icon';\nimport InformationOutlineIcon from '@mattermost/compass-icons/components/information-outline';\nimport AlertOutlineIcon from '@mattermost/compass-icons/components/alert-outline';\nimport AlertCircleOutlineIcon from '@mattermost/compass-icons/components/alert-circle-outline';\nimport CheckCircleOutlineIcon from '@mattermost/compass-icons/components/check-circle-outline';\nimport CloseIcon from '@mattermost/compass-icons/components/close';\nimport type { BuiltInButtonProps } from '@/utils/props';\nimport { mergeClassNames } from '@/utils/props';\nimport styles from './SectionNotice.module.scss';\n\nexport type SectionNoticeType =\n | 'info'\n | 'warning'\n | 'danger'\n | 'success'\n | 'hint';\n\nexport interface SectionNoticeProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /** Optional CSS class name. */\n className?: string;\n /** Type controls color-coding. Default: Info. */\n type?: SectionNoticeType;\n /** Optional leading icon. When omitted a default type icon is shown. Pass `<Icon glyph={<SomeIcon />} />` — SectionNotice provides the correct size via context. */\n icon?: ReactNode;\n /** Title / headline. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n title: ReactNode;\n /** Optional body description. */\n description?: ReactNode;\n /** Primary action button label. */\n primaryButtonLabel?: ReactNode;\n /** Primary action callback. */\n onPrimaryAction?: () => void;\n /** Disables the primary action button. */\n primaryActionDisabled?: boolean;\n /** Shows a spinner in the primary action button and disables it. */\n primaryActionLoading?: boolean;\n /** Secondary action button label. */\n secondaryButtonLabel?: ReactNode;\n /** Secondary action callback. */\n onSecondaryAction?: () => void;\n /** Disables the secondary action button. */\n secondaryActionDisabled?: boolean;\n /** Shows a spinner in the secondary action button and disables it. */\n secondaryActionLoading?: boolean;\n /** Called when dismiss (×) button is clicked. When omitted, dismiss button is hidden. */\n onDismiss?: () => void;\n /** Accessible name for the dismiss button. Default: \"Dismiss\". */\n dismissLabel?: string;\n /** Extra attributes for the dismiss button (e.g. `data-testid`). */\n dismissButtonProps?: BuiltInButtonProps;\n}\n\nconst DEFAULT_ICONS: Record<SectionNoticeType, ReactNode> = {\n info: <Icon size=\"20\" glyph={<InformationOutlineIcon />} />,\n warning: <Icon size=\"20\" glyph={<AlertCircleOutlineIcon />} />,\n danger: <Icon size=\"20\" glyph={<AlertOutlineIcon />} />,\n success: <Icon size=\"20\" glyph={<CheckCircleOutlineIcon />} />,\n hint: <Icon size=\"20\" glyph={<InformationOutlineIcon />} />,\n};\n\n/**\n * A Section Notice is an in-context alert that lives inside a settings page, admin panel, or\n * other content region. Use it to flag important information, report a state change, or\n * surface a problem the user needs to act on — without yanking them out of the flow.\n */\nexport default function SectionNotice({\n className = '',\n type = 'info',\n icon,\n title,\n description,\n primaryButtonLabel,\n onPrimaryAction,\n secondaryButtonLabel,\n onSecondaryAction,\n primaryActionDisabled,\n primaryActionLoading,\n secondaryActionDisabled,\n secondaryActionLoading,\n onDismiss,\n dismissLabel = 'Dismiss',\n dismissButtonProps,\n ...rest\n}: SectionNoticeProps) {\n const typeClass = styles[`section-notice--type-${type.toLowerCase()}`];\n\n const rootClass = [styles['section-notice'], typeClass, className]\n .filter(Boolean)\n .join(' ');\n\n const resolvedIcon = icon !== undefined ? icon : DEFAULT_ICONS[type];\n\n const hasActions = primaryButtonLabel != null || secondaryButtonLabel != null;\n\n return (\n <div {...rest} className={rootClass}>\n <div className={styles['section-notice__content']}>\n {resolvedIcon != null && (\n <span className={styles['section-notice__icon']} aria-hidden>\n <IconSlotContext.Provider value={{ size: '20' }}>\n {resolvedIcon}\n </IconSlotContext.Provider>\n </span>\n )}\n <div className={styles['section-notice__body']}>\n <h4 className={styles['section-notice__title']}>{title}</h4>\n {description != null && (\n <div className={styles['section-notice__description']}>\n {description}\n </div>\n )}\n {hasActions && (\n <div className={styles['section-notice__actions']}>\n {primaryButtonLabel != null && (\n <Button\n emphasis=\"primary\"\n size=\"small\"\n disabled={primaryActionDisabled}\n loading={primaryActionLoading}\n onClick={onPrimaryAction}\n >\n {primaryButtonLabel}\n </Button>\n )}\n {secondaryButtonLabel != null && (\n <Button\n emphasis=\"tertiary\"\n size=\"small\"\n disabled={secondaryActionDisabled}\n loading={secondaryActionLoading}\n onClick={onSecondaryAction}\n >\n {secondaryButtonLabel}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n {onDismiss != null && (\n <IconButton\n {...dismissButtonProps}\n className={mergeClassNames(\n styles['section-notice__dismiss'],\n dismissButtonProps?.className,\n )}\n aria-label={dismissLabel}\n size=\"small\"\n icon={<Icon size=\"16\" glyph={<CloseIcon />} />}\n onClick={onDismiss}\n />\n )}\n </div>\n );\n}\n"],"names":["DEFAULT_ICONS","Icon","jsx","InformationOutlineIcon","AlertCircleOutlineIcon","AlertOutlineIcon","CheckCircleOutlineIcon","SectionNotice","className","type","icon","title","description","primaryButtonLabel","onPrimaryAction","secondaryButtonLabel","onSecondaryAction","primaryActionDisabled","primaryActionLoading","secondaryActionDisabled","secondaryActionLoading","onDismiss","dismissLabel","dismissButtonProps","rest","typeClass","styles","rootClass","resolvedIcon","hasActions","jsxs","IconSlotContext","Button","IconButton","mergeClassNames","CloseIcon"],"mappings":"upBA2DMA,EAAsD,CAC1D,WAAOC,UAAA,CAAK,KAAK,KAAK,MAAOC,MAACC,IAAuB,EAAI,EACzD,cAAUF,UAAA,CAAK,KAAK,KAAK,MAAOC,MAACE,IAAuB,EAAI,EAC5D,aAASH,UAAA,CAAK,KAAK,KAAK,MAAOC,MAACG,IAAiB,EAAI,EACrD,cAAUJ,UAAA,CAAK,KAAK,KAAK,MAAOC,MAACI,IAAuB,EAAI,EAC5D,WAAOL,EAAAA,QAAA,CAAK,KAAK,KAAK,MAAOC,EAAAA,IAACC,IAAuB,CAAA,CAAI,CAC3D,EAOA,SAAwBI,EAAc,CACpC,UAAAC,EAAY,GACZ,KAAAC,EAAO,OACP,KAAAC,EACA,MAAAC,EACA,YAAAC,EACA,mBAAAC,EACA,gBAAAC,EACA,qBAAAC,EACA,kBAAAC,EACA,sBAAAC,EACA,qBAAAC,EACA,wBAAAC,EACA,uBAA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AAA,CAEJ,CAAA,EACF,EACCM,GAAa,MACZnB,EAAAA,IAAC+B,EAAAA,QAAA,CACE,GAAGV,EACJ,UAAWW,EAAAA,gBACTR,EAAAA,QAAO,yBAAyB,EAChCH,GAAA,YAAAA,EAAoB,SAAA,EAEtB,aAAYD,EACZ,KAAK,QACL,WAAOrB,UAAA,CAAK,KAAK,KAAK,MAAOC,MAACiC,IAAU,EAAI,EAC5C,QAASd,CAAA,CAAA,CACX,EAEJ,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
._section-
|
|
1
|
+
._section-notice_1fkh6_2{display:flex;flex-direction:column;align-items:flex-end;position:relative;border-radius:var(--radius-s);border:1px solid rgba(var(--color-info-rgb),.16);background-color:rgba(var(--color-info-rgb),.04)}._section-notice__content_1fkh6_11{display:flex;align-items:flex-start;gap:var(--spacing-m);padding:var(--spacing-m);width:100%}._section-notice__icon_1fkh6_18{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--color-info)}._section-notice__body_1fkh6_25{display:flex;flex:1 0 0;flex-direction:column;gap:var(--spacing-xs);min-width:0;overflow:hidden;padding-right:var(--spacing-xl)}._section-notice__title_1fkh6_34{margin:0;padding:0;font-family:var(--font-family-body);font-size:var(--font-size-100);font-weight:var(--font-weight-semibold);line-height:var(--line-height-100);letter-spacing:var(--letter-spacing-normal);text-transform:none;color:var(--center-channel-color)}._section-notice__description_1fkh6_45{font-size:var(--font-size-100);font-weight:var(--font-weight-regular);line-height:var(--line-height-100);color:var(--center-channel-color)}._section-notice__actions_1fkh6_51{display:flex;align-items:center;gap:var(--spacing-s);padding:var(--spacing-xxs) 0}._section-notice__dismiss_1fkh6_57{position:absolute;top:var(--spacing-xxs);right:var(--spacing-xxs)}._section-notice--type-warning_1fkh6_62{background-color:rgba(var(--color-warning-rgb),.04);border-color:rgba(var(--color-warning-rgb),.16)}._section-notice--type-warning_1fkh6_62 ._section-notice__icon_1fkh6_18{color:var(--color-warning)}._section-notice--type-danger_1fkh6_69{background-color:rgba(var(--error-text-color-rgb, var(--color-danger-rgb)),.04);border-color:rgba(var(--error-text-color-rgb, var(--color-danger-rgb)),.16)}._section-notice--type-danger_1fkh6_69 ._section-notice__icon_1fkh6_18{color:var(--error-text, var(--color-danger))}._section-notice--type-success_1fkh6_76{background-color:rgba(var(--color-success-rgb),.04);border-color:rgba(var(--color-success-rgb),.16)}._section-notice--type-success_1fkh6_76 ._section-notice__icon_1fkh6_18{color:var(--color-success)}._section-notice--type-hint_1fkh6_83{background-color:rgba(var(--center-channel-color-rgb),.04);border-color:rgba(var(--center-channel-color-rgb),.16)}._section-notice--type-hint_1fkh6_83 ._section-notice__icon_1fkh6_18{color:rgba(var(--center-channel-color-rgb),.64)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import h from "../button/Button.js";
|
|
3
3
|
import A from "../icon-button/IconButton.js";
|
|
4
|
-
import
|
|
4
|
+
import l, { IconSlotContext as j } from "../icon/Icon.js";
|
|
5
5
|
import __f from "@mattermost/compass-icons/components/information-outline.js";const f=__f&&__f.default?__f.default:__f;
|
|
6
6
|
import __S from "@mattermost/compass-icons/components/alert-outline.js";const S=__S&&__S.default?__S.default:__S;
|
|
7
7
|
import __w from "@mattermost/compass-icons/components/alert-circle-outline.js";const w=__w&&__w.default?__w.default:__w;
|
|
@@ -10,11 +10,11 @@ import __E from "@mattermost/compass-icons/components/close.js";const E=__E&&__E
|
|
|
10
10
|
import { mergeClassNames as F } from "../../utils/props.js";
|
|
11
11
|
import i from "./SectionNotice.module.scss.js";
|
|
12
12
|
const T = {
|
|
13
|
-
info: /* @__PURE__ */ e(
|
|
14
|
-
warning: /* @__PURE__ */ e(
|
|
15
|
-
danger: /* @__PURE__ */ e(
|
|
16
|
-
success: /* @__PURE__ */ e(
|
|
17
|
-
hint: /* @__PURE__ */ e(
|
|
13
|
+
info: /* @__PURE__ */ e(l, { size: "20", glyph: /* @__PURE__ */ e(f, {}) }),
|
|
14
|
+
warning: /* @__PURE__ */ e(l, { size: "20", glyph: /* @__PURE__ */ e(w, {}) }),
|
|
15
|
+
danger: /* @__PURE__ */ e(l, { size: "20", glyph: /* @__PURE__ */ e(S, {}) }),
|
|
16
|
+
success: /* @__PURE__ */ e(l, { size: "20", glyph: /* @__PURE__ */ e(D, {}) }),
|
|
17
|
+
hint: /* @__PURE__ */ e(l, { size: "20", glyph: /* @__PURE__ */ e(f, {}) })
|
|
18
18
|
};
|
|
19
19
|
function V({
|
|
20
20
|
className: p = "",
|
|
@@ -32,17 +32,17 @@ function V({
|
|
|
32
32
|
secondaryActionLoading: z,
|
|
33
33
|
onDismiss: m,
|
|
34
34
|
dismissLabel: v = "Dismiss",
|
|
35
|
-
dismissButtonProps:
|
|
35
|
+
dismissButtonProps: n,
|
|
36
36
|
...y
|
|
37
37
|
}) {
|
|
38
38
|
const O = i[`section-notice--type-${t.toLowerCase()}`], k = [i["section-notice"], O, p].filter(Boolean).join(" "), d = r !== void 0 ? r : T[t], x = c != null || s != null;
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ o("div", { ...y, className: k, children: [
|
|
40
|
+
/* @__PURE__ */ o("div", { className: i["section-notice__content"], children: [
|
|
41
41
|
d != null && /* @__PURE__ */ e("span", { className: i["section-notice__icon"], "aria-hidden": !0, children: /* @__PURE__ */ e(j.Provider, { value: { size: "20" }, children: d }) }),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */ e("
|
|
42
|
+
/* @__PURE__ */ o("div", { className: i["section-notice__body"], children: [
|
|
43
|
+
/* @__PURE__ */ e("h4", { className: i["section-notice__title"], children: _ }),
|
|
44
44
|
a != null && /* @__PURE__ */ e("div", { className: i["section-notice__description"], children: a }),
|
|
45
|
-
x && /* @__PURE__ */
|
|
45
|
+
x && /* @__PURE__ */ o("div", { className: i["section-notice__actions"], children: [
|
|
46
46
|
c != null && /* @__PURE__ */ e(
|
|
47
47
|
h,
|
|
48
48
|
{
|
|
@@ -57,7 +57,7 @@ function V({
|
|
|
57
57
|
s != null && /* @__PURE__ */ e(
|
|
58
58
|
h,
|
|
59
59
|
{
|
|
60
|
-
emphasis: "
|
|
60
|
+
emphasis: "tertiary",
|
|
61
61
|
size: "small",
|
|
62
62
|
disabled: u,
|
|
63
63
|
loading: z,
|
|
@@ -71,14 +71,14 @@ function V({
|
|
|
71
71
|
m != null && /* @__PURE__ */ e(
|
|
72
72
|
A,
|
|
73
73
|
{
|
|
74
|
-
...
|
|
74
|
+
...n,
|
|
75
75
|
className: F(
|
|
76
76
|
i["section-notice__dismiss"],
|
|
77
|
-
|
|
77
|
+
n == null ? void 0 : n.className
|
|
78
78
|
),
|
|
79
79
|
"aria-label": v,
|
|
80
80
|
size: "small",
|
|
81
|
-
icon: /* @__PURE__ */ e(
|
|
81
|
+
icon: /* @__PURE__ */ e(l, { size: "16", glyph: /* @__PURE__ */ e(E, {}) }),
|
|
82
82
|
onClick: m
|
|
83
83
|
}
|
|
84
84
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionNotice.js","sources":["../../../src/components/section-notice/SectionNotice.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\nimport Button from '@/components/button/Button';\nimport IconButton from '@/components/icon-button/IconButton';\nimport Icon from '@/components/icon/Icon';\nimport { IconSlotContext } from '@/components/icon/Icon';\nimport InformationOutlineIcon from '@mattermost/compass-icons/components/information-outline';\nimport AlertOutlineIcon from '@mattermost/compass-icons/components/alert-outline';\nimport AlertCircleOutlineIcon from '@mattermost/compass-icons/components/alert-circle-outline';\nimport CheckCircleOutlineIcon from '@mattermost/compass-icons/components/check-circle-outline';\nimport CloseIcon from '@mattermost/compass-icons/components/close';\nimport type { BuiltInButtonProps } from '@/utils/props';\nimport { mergeClassNames } from '@/utils/props';\nimport styles from './SectionNotice.module.scss';\n\nexport type SectionNoticeType =\n | 'info'\n | 'warning'\n | 'danger'\n | 'success'\n | 'hint';\n\nexport interface SectionNoticeProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /** Optional CSS class name. */\n className?: string;\n /** Type controls color-coding. Default: Info. */\n type?: SectionNoticeType;\n /** Optional leading icon. When omitted a default type icon is shown. Pass `<Icon glyph={<SomeIcon />} />` — SectionNotice provides the correct size via context. */\n icon?: ReactNode;\n /** Title / headline. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n title: ReactNode;\n /** Optional body description. */\n description?: ReactNode;\n /** Primary action button label. */\n primaryButtonLabel?: ReactNode;\n /** Primary action callback. */\n onPrimaryAction?: () => void;\n /** Disables the primary action button. */\n primaryActionDisabled?: boolean;\n /** Shows a spinner in the primary action button and disables it. */\n primaryActionLoading?: boolean;\n /** Secondary action button label. */\n secondaryButtonLabel?: ReactNode;\n /** Secondary action callback. */\n onSecondaryAction?: () => void;\n /** Disables the secondary action button. */\n secondaryActionDisabled?: boolean;\n /** Shows a spinner in the secondary action button and disables it. */\n secondaryActionLoading?: boolean;\n /** Called when dismiss (×) button is clicked. When omitted, dismiss button is hidden. */\n onDismiss?: () => void;\n /** Accessible name for the dismiss button. Default: \"Dismiss\". */\n dismissLabel?: string;\n /** Extra attributes for the dismiss button (e.g. `data-testid`). */\n dismissButtonProps?: BuiltInButtonProps;\n}\n\nconst DEFAULT_ICONS: Record<SectionNoticeType, ReactNode> = {\n info: <Icon size=\"20\" glyph={<InformationOutlineIcon />} />,\n warning: <Icon size=\"20\" glyph={<AlertCircleOutlineIcon />} />,\n danger: <Icon size=\"20\" glyph={<AlertOutlineIcon />} />,\n success: <Icon size=\"20\" glyph={<CheckCircleOutlineIcon />} />,\n hint: <Icon size=\"20\" glyph={<InformationOutlineIcon />} />,\n};\n\n/**\n * A Section Notice is an in-context alert that lives inside a settings page, admin panel, or\n * other content region. Use it to flag important information, report a state change, or\n * surface a problem the user needs to act on — without yanking them out of the flow.\n */\nexport default function SectionNotice({\n className = '',\n type = 'info',\n icon,\n title,\n description,\n primaryButtonLabel,\n onPrimaryAction,\n secondaryButtonLabel,\n onSecondaryAction,\n primaryActionDisabled,\n primaryActionLoading,\n secondaryActionDisabled,\n secondaryActionLoading,\n onDismiss,\n dismissLabel = 'Dismiss',\n dismissButtonProps,\n ...rest\n}: SectionNoticeProps) {\n const typeClass = styles[`section-notice--type-${type.toLowerCase()}`];\n\n const rootClass = [styles['section-notice'], typeClass, className]\n .filter(Boolean)\n .join(' ');\n\n const resolvedIcon = icon !== undefined ? icon : DEFAULT_ICONS[type];\n\n const hasActions = primaryButtonLabel != null || secondaryButtonLabel != null;\n\n return (\n <div {...rest} className={rootClass}>\n <div className={styles['section-notice__content']}>\n {resolvedIcon != null && (\n <span className={styles['section-notice__icon']} aria-hidden>\n <IconSlotContext.Provider value={{ size: '20' }}>\n {resolvedIcon}\n </IconSlotContext.Provider>\n </span>\n )}\n <div className={styles['section-notice__body']}>\n <
|
|
1
|
+
{"version":3,"file":"SectionNotice.js","sources":["../../../src/components/section-notice/SectionNotice.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\nimport Button from '@/components/button/Button';\nimport IconButton from '@/components/icon-button/IconButton';\nimport Icon from '@/components/icon/Icon';\nimport { IconSlotContext } from '@/components/icon/Icon';\nimport InformationOutlineIcon from '@mattermost/compass-icons/components/information-outline';\nimport AlertOutlineIcon from '@mattermost/compass-icons/components/alert-outline';\nimport AlertCircleOutlineIcon from '@mattermost/compass-icons/components/alert-circle-outline';\nimport CheckCircleOutlineIcon from '@mattermost/compass-icons/components/check-circle-outline';\nimport CloseIcon from '@mattermost/compass-icons/components/close';\nimport type { BuiltInButtonProps } from '@/utils/props';\nimport { mergeClassNames } from '@/utils/props';\nimport styles from './SectionNotice.module.scss';\n\nexport type SectionNoticeType =\n | 'info'\n | 'warning'\n | 'danger'\n | 'success'\n | 'hint';\n\nexport interface SectionNoticeProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /** Optional CSS class name. */\n className?: string;\n /** Type controls color-coding. Default: Info. */\n type?: SectionNoticeType;\n /** Optional leading icon. When omitted a default type icon is shown. Pass `<Icon glyph={<SomeIcon />} />` — SectionNotice provides the correct size via context. */\n icon?: ReactNode;\n /** Title / headline. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n title: ReactNode;\n /** Optional body description. */\n description?: ReactNode;\n /** Primary action button label. */\n primaryButtonLabel?: ReactNode;\n /** Primary action callback. */\n onPrimaryAction?: () => void;\n /** Disables the primary action button. */\n primaryActionDisabled?: boolean;\n /** Shows a spinner in the primary action button and disables it. */\n primaryActionLoading?: boolean;\n /** Secondary action button label. */\n secondaryButtonLabel?: ReactNode;\n /** Secondary action callback. */\n onSecondaryAction?: () => void;\n /** Disables the secondary action button. */\n secondaryActionDisabled?: boolean;\n /** Shows a spinner in the secondary action button and disables it. */\n secondaryActionLoading?: boolean;\n /** Called when dismiss (×) button is clicked. When omitted, dismiss button is hidden. */\n onDismiss?: () => void;\n /** Accessible name for the dismiss button. Default: \"Dismiss\". */\n dismissLabel?: string;\n /** Extra attributes for the dismiss button (e.g. `data-testid`). */\n dismissButtonProps?: BuiltInButtonProps;\n}\n\nconst DEFAULT_ICONS: Record<SectionNoticeType, ReactNode> = {\n info: <Icon size=\"20\" glyph={<InformationOutlineIcon />} />,\n warning: <Icon size=\"20\" glyph={<AlertCircleOutlineIcon />} />,\n danger: <Icon size=\"20\" glyph={<AlertOutlineIcon />} />,\n success: <Icon size=\"20\" glyph={<CheckCircleOutlineIcon />} />,\n hint: <Icon size=\"20\" glyph={<InformationOutlineIcon />} />,\n};\n\n/**\n * A Section Notice is an in-context alert that lives inside a settings page, admin panel, or\n * other content region. Use it to flag important information, report a state change, or\n * surface a problem the user needs to act on — without yanking them out of the flow.\n */\nexport default function SectionNotice({\n className = '',\n type = 'info',\n icon,\n title,\n description,\n primaryButtonLabel,\n onPrimaryAction,\n secondaryButtonLabel,\n onSecondaryAction,\n primaryActionDisabled,\n primaryActionLoading,\n secondaryActionDisabled,\n secondaryActionLoading,\n onDismiss,\n dismissLabel = 'Dismiss',\n dismissButtonProps,\n ...rest\n}: SectionNoticeProps) {\n const typeClass = styles[`section-notice--type-${type.toLowerCase()}`];\n\n const rootClass = [styles['section-notice'], typeClass, className]\n .filter(Boolean)\n .join(' ');\n\n const resolvedIcon = icon !== undefined ? icon : DEFAULT_ICONS[type];\n\n const hasActions = primaryButtonLabel != null || secondaryButtonLabel != null;\n\n return (\n <div {...rest} className={rootClass}>\n <div className={styles['section-notice__content']}>\n {resolvedIcon != null && (\n <span className={styles['section-notice__icon']} aria-hidden>\n <IconSlotContext.Provider value={{ size: '20' }}>\n {resolvedIcon}\n </IconSlotContext.Provider>\n </span>\n )}\n <div className={styles['section-notice__body']}>\n <h4 className={styles['section-notice__title']}>{title}</h4>\n {description != null && (\n <div className={styles['section-notice__description']}>\n {description}\n </div>\n )}\n {hasActions && (\n <div className={styles['section-notice__actions']}>\n {primaryButtonLabel != null && (\n <Button\n emphasis=\"primary\"\n size=\"small\"\n disabled={primaryActionDisabled}\n loading={primaryActionLoading}\n onClick={onPrimaryAction}\n >\n {primaryButtonLabel}\n </Button>\n )}\n {secondaryButtonLabel != null && (\n <Button\n emphasis=\"tertiary\"\n size=\"small\"\n disabled={secondaryActionDisabled}\n loading={secondaryActionLoading}\n onClick={onSecondaryAction}\n >\n {secondaryButtonLabel}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n {onDismiss != null && (\n <IconButton\n {...dismissButtonProps}\n className={mergeClassNames(\n styles['section-notice__dismiss'],\n dismissButtonProps?.className,\n )}\n aria-label={dismissLabel}\n size=\"small\"\n icon={<Icon size=\"16\" glyph={<CloseIcon />} />}\n onClick={onDismiss}\n />\n )}\n </div>\n );\n}\n"],"names":["DEFAULT_ICONS","Icon","jsx","InformationOutlineIcon","AlertCircleOutlineIcon","AlertOutlineIcon","CheckCircleOutlineIcon","SectionNotice","className","type","icon","title","description","primaryButtonLabel","onPrimaryAction","secondaryButtonLabel","onSecondaryAction","primaryActionDisabled","primaryActionLoading","secondaryActionDisabled","secondaryActionLoading","onDismiss","dismissLabel","dismissButtonProps","rest","typeClass","styles","rootClass","resolvedIcon","hasActions","jsxs","IconSlotContext","Button","IconButton","mergeClassNames","CloseIcon"],"mappings":";;;;;;;;;;;AA2DA,MAAMA,IAAsD;AAAA,EAC1D,wBAAOC,GAAA,EAAK,MAAK,MAAK,OAAO,gBAAAC,EAACC,KAAuB,GAAI;AAAA,EACzD,2BAAUF,GAAA,EAAK,MAAK,MAAK,OAAO,gBAAAC,EAACE,KAAuB,GAAI;AAAA,EAC5D,0BAASH,GAAA,EAAK,MAAK,MAAK,OAAO,gBAAAC,EAACG,KAAiB,GAAI;AAAA,EACrD,2BAAUJ,GAAA,EAAK,MAAK,MAAK,OAAO,gBAAAC,EAACI,KAAuB,GAAI;AAAA,EAC5D,wBAAOL,GAAA,EAAK,MAAK,MAAK,OAAO,gBAAAC,EAACC,KAAuB,EAAA,CAAI;AAC3D;AAOA,SAAwBI,EAAc;AAAA,EACpC,WAAAC,IAAY;AAAA,EACZ,MAAAC,IAAO;AAAA,EACP,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,oBAAAC;AAAA,EACA,GAAGC;AACL,GAAuB;AACrB,QAAMC,IAAYC,EAAO,wBAAwBjB,EAAK,YAAA,CAAa,EAAE,GAE/DkB,IAAY,CAACD,EAAO,gBAAgB,GAAGD,GAAWjB,CAAS,EAC9D,OAAO,OAAO,EACd,KAAK,GAAG,GAELoB,IAAelB,MAAS,SAAYA,IAAOV,EAAcS,CAAI,G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EAAO,yBAAyB;AAAA,UAChCH,KAAA,gBAAAA,EAAoB;AAAA,QAAA;AAAA,QAEtB,cAAYD;AAAA,QACZ,MAAK;AAAA,QACL,wBAAOrB,GAAA,EAAK,MAAK,MAAK,OAAO,gBAAAC,EAACiC,KAAU,GAAI;AAAA,QAC5C,SAASd;AAAA,MAAA;AAAA,IAAA;AAAA,EACX,GAEJ;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./SectionNotice.css');const e={"section-notice":"_section-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./SectionNotice.css');const e={"section-notice":"_section-notice_1fkh6_2","section-notice__content":"_section-notice__content_1fkh6_11","section-notice__icon":"_section-notice__icon_1fkh6_18","section-notice__body":"_section-notice__body_1fkh6_25","section-notice__title":"_section-notice__title_1fkh6_34","section-notice__description":"_section-notice__description_1fkh6_45","section-notice__actions":"_section-notice__actions_1fkh6_51","section-notice__dismiss":"_section-notice__dismiss_1fkh6_57","section-notice--type-warning":"_section-notice--type-warning_1fkh6_62","section-notice--type-danger":"_section-notice--type-danger_1fkh6_69","section-notice--type-success":"_section-notice--type-success_1fkh6_76","section-notice--type-hint":"_section-notice--type-hint_1fkh6_83"};exports.default=e;
|
|
2
2
|
//# sourceMappingURL=SectionNotice.module.scss.cjs.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import './SectionNotice.css';const t = {
|
|
2
|
-
"section-notice": "_section-
|
|
3
|
-
"section-notice__content": "_section-
|
|
4
|
-
"section-notice__icon": "_section-
|
|
5
|
-
"section-notice__body": "_section-
|
|
6
|
-
"section-notice__title": "_section-
|
|
7
|
-
"section-notice__description": "_section-
|
|
8
|
-
"section-notice__actions": "_section-
|
|
9
|
-
"section-notice__dismiss": "_section-
|
|
10
|
-
"section-notice--type-warning": "_section-notice--type-
|
|
11
|
-
"section-notice--type-danger": "_section-notice--type-
|
|
12
|
-
"section-notice--type-success": "_section-notice--type-
|
|
13
|
-
"section-notice--type-hint": "_section-notice--type-
|
|
2
|
+
"section-notice": "_section-notice_1fkh6_2",
|
|
3
|
+
"section-notice__content": "_section-notice__content_1fkh6_11",
|
|
4
|
+
"section-notice__icon": "_section-notice__icon_1fkh6_18",
|
|
5
|
+
"section-notice__body": "_section-notice__body_1fkh6_25",
|
|
6
|
+
"section-notice__title": "_section-notice__title_1fkh6_34",
|
|
7
|
+
"section-notice__description": "_section-notice__description_1fkh6_45",
|
|
8
|
+
"section-notice__actions": "_section-notice__actions_1fkh6_51",
|
|
9
|
+
"section-notice__dismiss": "_section-notice__dismiss_1fkh6_57",
|
|
10
|
+
"section-notice--type-warning": "_section-notice--type-warning_1fkh6_62",
|
|
11
|
+
"section-notice--type-danger": "_section-notice--type-danger_1fkh6_69",
|
|
12
|
+
"section-notice--type-success": "_section-notice--type-success_1fkh6_76",
|
|
13
|
+
"section-notice--type-hint": "_section-notice--type-hint_1fkh6_83"
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
16
|
t as default
|