@mattermost/compass-ui 0.1.0-alpha.20 → 0.1.0-alpha.22
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/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 +55 -3
- package/dist/components/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.js +299 -272
- 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 +25 -25
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.d.ts.map +1 -1
- package/dist/components/date-range-picker/DateRangePicker.css +1 -1
- package/dist/components/date-range-picker/DateRangePicker.module.scss.cjs +1 -1
- package/dist/components/date-range-picker/DateRangePicker.module.scss.js +26 -26
- package/dist/components/emoji-popover/EmojiPopover.css +1 -1
- package/dist/components/emoji-popover/EmojiPopover.module.scss.cjs +1 -1
- package/dist/components/emoji-popover/EmojiPopover.module.scss.js +21 -21
- 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 +6 -1
- 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 +18 -18
- package/dist/components/modal/Modal.cjs +1 -1
- package/dist/components/modal/Modal.cjs.map +1 -1
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +91 -93
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/ModalOverlay.cjs +2 -0
- package/dist/components/modal/ModalOverlay.cjs.map +1 -0
- package/dist/components/modal/ModalOverlay.css +1 -1
- package/dist/components/modal/ModalOverlay.d.ts +43 -0
- package/dist/components/modal/ModalOverlay.d.ts.map +1 -0
- package/dist/components/modal/ModalOverlay.js +59 -0
- package/dist/components/modal/ModalOverlay.js.map +1 -0
- package/dist/components/modal/ModalOverlay.module.scss.cjs +1 -1
- package/dist/components/modal/ModalOverlay.module.scss.js +3 -3
- package/dist/components/modal/index.cjs +1 -1
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/modal/index.js +4 -2
- package/dist/components/modal/index.js.map +1 -1
- package/dist/components/password-input/PasswordInput.css +1 -1
- package/dist/components/password-input/PasswordInput.module.scss.cjs +1 -1
- package/dist/components/password-input/PasswordInput.module.scss.js +12 -12
- package/dist/components/popover-menu/PopoverMenu.cjs +1 -1
- package/dist/components/popover-menu/PopoverMenu.cjs.map +1 -1
- package/dist/components/popover-menu/PopoverMenu.css +1 -1
- package/dist/components/popover-menu/PopoverMenu.d.ts +6 -2
- package/dist/components/popover-menu/PopoverMenu.d.ts.map +1 -1
- package/dist/components/popover-menu/PopoverMenu.js +29 -29
- package/dist/components/popover-menu/PopoverMenu.js.map +1 -1
- package/dist/components/popover-menu/PopoverMenu.module.scss.cjs +1 -1
- package/dist/components/popover-menu/PopoverMenu.module.scss.js +13 -12
- package/dist/components/popover-menu/PopoverMenu.module.scss.js.map +1 -1
- package/dist/components/profile-popover/ProfilePopover.css +1 -1
- package/dist/components/profile-popover/ProfilePopover.module.scss.cjs +1 -1
- package/dist/components/profile-popover/ProfilePopover.module.scss.js +33 -33
- package/dist/components/search-input/SearchInput.css +1 -1
- package/dist/components/search-input/SearchInput.module.scss.cjs +1 -1
- package/dist/components/search-input/SearchInput.module.scss.js +15 -15
- package/dist/components/team-avatar/TeamAvatar.cjs +1 -1
- package/dist/components/team-avatar/TeamAvatar.cjs.map +1 -1
- package/dist/components/team-avatar/TeamAvatar.css +1 -1
- package/dist/components/team-avatar/TeamAvatar.d.ts +8 -1
- package/dist/components/team-avatar/TeamAvatar.d.ts.map +1 -1
- package/dist/components/team-avatar/TeamAvatar.js +23 -21
- package/dist/components/team-avatar/TeamAvatar.js.map +1 -1
- package/dist/components/team-avatar/TeamAvatar.module.scss.cjs +1 -1
- package/dist/components/team-avatar/TeamAvatar.module.scss.js +17 -16
- package/dist/components/team-avatar/TeamAvatar.module.scss.js.map +1 -1
- package/dist/components/team-avatar/index.d.ts +1 -1
- package/dist/components/team-avatar/index.d.ts.map +1 -1
- package/dist/components/text-area/TextArea.css +1 -1
- package/dist/components/text-area/TextArea.module.scss.cjs +1 -1
- package/dist/components/text-area/TextArea.module.scss.js +12 -12
- package/dist/components/text-input/TextInput.css +1 -1
- package/dist/components/text-input/TextInput.module.scss.cjs +1 -1
- package/dist/components/text-input/TextInput.module.scss.js +19 -19
- package/dist/components/tile-button/TileButton.cjs +2 -0
- package/dist/components/tile-button/TileButton.cjs.map +1 -0
- package/dist/components/tile-button/TileButton.css +1 -0
- package/dist/components/tile-button/TileButton.d.ts +54 -0
- package/dist/components/tile-button/TileButton.d.ts.map +1 -0
- package/dist/components/tile-button/TileButton.js +74 -0
- package/dist/components/tile-button/TileButton.js.map +1 -0
- package/dist/components/tile-button/TileButton.module.scss.cjs +2 -0
- package/dist/components/tile-button/TileButton.module.scss.cjs.map +1 -0
- package/dist/components/tile-button/TileButton.module.scss.js +12 -0
- package/dist/components/tile-button/TileButton.module.scss.js.map +1 -0
- package/dist/components/{action-button → tile-button}/index.cjs +1 -1
- package/dist/components/tile-button/index.d.ts +3 -0
- package/dist/components/tile-button/index.d.ts.map +1 -0
- package/dist/components/tile-button/index.js +5 -0
- package/dist/components/tour-point/TourPoint.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.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +111 -109
- package/dist/index.js.map +1 -1
- package/dist/utils/scrollLock.cjs +2 -0
- package/dist/utils/scrollLock.cjs.map +1 -0
- package/dist/utils/scrollLock.d.ts +9 -0
- package/dist/utils/scrollLock.d.ts.map +1 -0
- package/dist/utils/scrollLock.js +38 -0
- package/dist/utils/scrollLock.js.map +1 -0
- package/dist/utils/slot.cjs.map +1 -1
- package/dist/utils/slot.d.ts +1 -1
- package/dist/utils/slot.js.map +1 -1
- package/dist/utils/useOnExited.cjs +2 -0
- package/dist/utils/useOnExited.cjs.map +1 -0
- package/dist/utils/useOnExited.d.ts +7 -0
- package/dist/utils/useOnExited.d.ts.map +1 -0
- package/dist/utils/useOnExited.js +14 -0
- package/dist/utils/useOnExited.js.map +1 -0
- package/package.json +5 -4
- package/dist/components/action-button/ActionButton.cjs +0 -2
- package/dist/components/action-button/ActionButton.cjs.map +0 -1
- package/dist/components/action-button/ActionButton.css +0 -1
- package/dist/components/action-button/ActionButton.d.ts +0 -54
- package/dist/components/action-button/ActionButton.d.ts.map +0 -1
- package/dist/components/action-button/ActionButton.js +0 -74
- package/dist/components/action-button/ActionButton.js.map +0 -1
- package/dist/components/action-button/ActionButton.module.scss.cjs +0 -2
- package/dist/components/action-button/ActionButton.module.scss.cjs.map +0 -1
- package/dist/components/action-button/ActionButton.module.scss.js +0 -12
- package/dist/components/action-button/ActionButton.module.scss.js.map +0 -1
- package/dist/components/action-button/index.d.ts +0 -3
- package/dist/components/action-button/index.d.ts.map +0 -1
- package/dist/components/action-button/index.js +0 -5
- /package/dist/components/{action-button → tile-button}/index.cjs.map +0 -0
- /package/dist/components/{action-button → tile-button}/index.js.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.cjs","sources":["../../../src/components/menu-item/MenuItem.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type 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 { IconSlotContext } from '@/components/icon/Icon';\nimport Tag from '@/components/tag/Tag';\nimport MentionBadge from '@/components/mention-badge/MentionBadge';\nimport type { DataAttributes } from '@/utils/props';\nimport styles from './MenuItem.module.scss';\n\nexport interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Primary label. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n label: ReactNode;\n /** Optional secondary label. */\n secondaryLabel?: ReactNode;\n /** Where the secondary label appears. Default: 'below'. */\n secondaryLabelPosition?: 'inline' | 'below';\n
|
|
1
|
+
{"version":3,"file":"MenuItem.cjs","sources":["../../../src/components/menu-item/MenuItem.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type 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 { IconSlotContext } from '@/components/icon/Icon';\nimport Tag from '@/components/tag/Tag';\nimport MentionBadge from '@/components/mention-badge/MentionBadge';\nimport type { DataAttributes } from '@/utils/props';\nimport styles from './MenuItem.module.scss';\n\nexport interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Primary label. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n label: ReactNode;\n /** Optional secondary label. */\n secondaryLabel?: ReactNode;\n /** Where the secondary label appears. Default: 'below'. */\n secondaryLabelPosition?: 'inline' | 'below';\n /**\n * Custom content for the leading slot. When omitted, shows placeholder icon.\n * When passing an icon, use `<Icon glyph={<SomeIcon />} />` — MenuItem provides\n * the correct size via context. A 24px avatar (User Avatar or Team Avatar)\n * fills the same slot as that icon, so the label stays on the same line.\n */\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 />} />` — MenuItem provides the correct size via context. */\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 /** Text of the `tag`. Default: \"NEW\". */\n tagLabel?: ReactNode;\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 * Props a host menu (`Combobox`, `Select`) can set itself on a row: ARIA and\n * selection state, keyboard / pointer handling, and the values it reads from the\n * option object (`label`, `secondaryLabel`, `leadingVisual`, `disabled`). They\n * can't be overridden through `menuItemProps`. This is the full set; each host\n * sets only some of the handlers (`Combobox` uses `onClick`, `Select` uses\n * `onPointerUp`) and passes the other one through. `autoFocus` is excluded too:\n * the host keeps focus on its input / trigger, and a row that grabs focus on\n * mount would take it away.\n */\nexport type MenuItemOwnedProps =\n | 'id'\n | 'role'\n | 'aria-selected'\n | 'autoFocus'\n | 'label'\n | 'secondaryLabel'\n | 'leadingVisual'\n | 'leadingElement'\n | 'trailingElement'\n | 'disabled'\n | 'active'\n | 'children'\n | 'onClick'\n | 'onMouseDown'\n | 'onMouseEnter'\n | 'onPointerUp';\n\n/**\n * Every `MenuItem` prop a host menu doesn't own (`secondaryLabelPosition`,\n * `trailingVisual`, `tag`, `mentionCount`, `destructive`, `className`, …), so\n * props added to `MenuItem` reach `Combobox` / `Select` rows automatically.\n * `Owned` is the set the host sets itself (default: all of `MenuItemOwnedProps`);\n * a host narrows it so the handlers it doesn't supply can still be passed.\n */\nexport type MenuItemPassthroughProps<\n Owned extends keyof MenuItemProps = MenuItemOwnedProps,\n> = Partial<Omit<MenuItemProps, Owned>> & DataAttributes;\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 */\nconst MenuItem = forwardRef<HTMLButtonElement, MenuItemProps>(function MenuItem(\n {\n label,\n secondaryLabel,\n secondaryLabelPosition = 'below',\n leadingVisual,\n leadingElement = true,\n trailingVisual,\n trailingElement = false,\n customStatusEmoji,\n tag = false,\n tagLabel = 'NEW',\n mentionCount,\n destructive = false,\n active = false,\n className = '',\n disabled,\n type = 'button',\n ...rest\n },\n ref,\n) {\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\n ref={ref}\n className={rootClass}\n type={type}\n disabled={disabled}\n {...rest}\n >\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 <IconSlotContext.Provider value={{ size: '16' }}>\n {leadingVisual ?? (\n <Icon glyph={<EmoticonHappyOutlineIcon />} size=\"16\" />\n )}\n </IconSlotContext.Provider>\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={tagLabel} />}\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 <IconSlotContext.Provider value={{ size: '16' }}>\n {trailingVisual ?? <Icon glyph={<CheckIcon />} size=\"16\" />}\n </IconSlotContext.Provider>\n </span>\n </div>\n )}\n </div>\n </button>\n );\n});\n\nMenuItem.displayName = 'MenuItem';\n\nexport default MenuItem;\n"],"names":["MenuItem","forwardRef","label","secondaryLabel","secondaryLabelPosition","leadingVisual","leadingElement","trailingVisual","trailingElement","customStatusEmoji","tag","tagLabel","mentionCount","destructive","active","className","disabled","type","rest","ref","rootClass","styles","jsx","jsxs","IconSlotContext","Icon","EmoticonHappyOutlineIcon","Tag","MentionBadge","CheckIcon"],"mappings":"qbAuFMA,EAAWC,EAAAA,WAA6C,SAC5D,CACE,MAAAC,EACA,eAAAC,EACA,uBAAAC,EAAyB,QACzB,cAAAC,EACA,eAAAC,EAAiB,GACjB,eAAAC,EACA,gBAAAC,EAAkB,GAClB,kBAAAC,EACA,IAAAC,EAAM,GACN,SAAAC,EAAW,MACX,aAAAC,EACA,YAAAC,EAAc,GACd,OAAAC,EAAS,GACT,UAAAC,EAAY,GACZ,SAAAC,EACA,KAAAC,EAAO,SACP,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAY,CAChBC,EAAAA,QAAO,WAAW,EAClBR,EAAcQ,EAAAA,QAAO,wBAAwB,EAAI,GACjDP,EAASO,EAAAA,QAAO,mBAAmB,EAAI,GACvCN,CAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,EAEX,OACEO,EAAAA,IAAC,SAAA,CACC,IAAAH,EACA,UAAWC,EACX,KAAAH,EACA,SAAAD,EACC,GAAGE,EAEJ,SAAAK,EAAAA,KAAC,MAAA,CAAI,UAAWF,UAAO,oBAAoB,EACxC,SAAA,CAAAf,GACCgB,EAAAA,IAAC,MAAA,CAAI,UAAWD,EAAAA,QAAO,iBAAiB,EACtC,SAAAC,EAAAA,IAAC,OAAA,CAAK,UAAWD,EAAAA,QAAO,2BAA2B,EAAG,cAAW,GAC/D,eAACG,EAAAA,gBAAgB,SAAhB,CAAyB,MAAO,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OH,MAACO,IAAU,EAAI,KAAK,KAAK,CAAA,CAC3D,CAAA,CAAA,CACF,CACF,CAAA,CAAA,CAEJ,CAAA,CAAA,CAGN,CAAC,EAED7B,EAAS,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
._menu-
|
|
1
|
+
._menu-item_1nie0_2{display:flex;flex-direction:column;align-items:flex-start;padding:var(--spacing-xxs) var(--spacing-l);background-color:var(--center-channel-bg);border:none;width:100%;text-align:left;cursor:pointer;font-family:var(--font-family-body);color:var(--center-channel-color);transition:background-color var(--duration-quick) var(--ease-transition),box-shadow var(--duration-quick) var(--ease-transition),color var(--duration-quick) var(--ease-transition)}._menu-item_1nie0_2:focus-visible{outline:none;background-color:var(--center-channel-bg);box-shadow:inset 0 0 0 2px var(--sidebar-text-active-border)}._menu-item_1nie0_2:hover:not(:disabled){background-color:rgba(var(--center-channel-color-rgb),.08)}._menu-item_1nie0_2:active:not(:disabled){background-color:rgba(var(--button-bg-rgb),.08)}._menu-item--active_1nie0_27:not(:disabled){background-color:rgba(var(--button-bg-rgb),.08)}._menu-item--active_1nie0_27:not(:disabled) ._menu-item__leading-visual_1nie0_30,._menu-item--active_1nie0_27:not(:disabled) ._menu-item__trailing-visual_1nie0_31{color:rgba(var(--center-channel-color-rgb),.72)}._menu-item--active_1nie0_27:hover:not(:disabled){background-color:rgba(var(--button-bg-rgb),.12)}._menu-item--active_1nie0_27:focus-visible:not(:disabled){background-color:rgba(var(--button-bg-rgb),.08);box-shadow:inset 0 0 0 2px var(--sidebar-text-active-border)}._menu-item_1nie0_2:disabled{cursor:not-allowed}._menu-item_1nie0_2:disabled ._menu-item__content_1nie0_44{opacity:.4}._menu-item__content_1nie0_44{display:flex;gap:var(--spacing-xxs);align-items:flex-start;width:100%}._menu-item__left_1nie0_53{display:flex;align-items:center;flex-shrink:0}._menu-item__leading-visual_1nie0_30,._menu-item__trailing-visual_1nie0_31{display:flex;align-items:center;justify-content:center;flex-shrink:0;color:rgba(var(--center-channel-color-rgb),.64)}._menu-item__leading-visual_1nie0_30{box-sizing:border-box;min-width:calc(var(--icon-size-16) + var(--spacing-xxxs) * 2);min-height:calc(var(--icon-size-16) + var(--spacing-xxxs) * 2)}._menu-item__trailing-visual_1nie0_31{padding:var(--spacing-xxxs)}._menu-item__trailing-visual_1nie0_31 kbd{padding:0;background:transparent;font-weight:var(--font-weight-regular);color:rgba(var(--center-channel-color-rgb),.72)}._menu-item__trailing-visual_1nie0_31 kbd+kbd{margin-inline-start:var(--spacing-xxxs)}._menu-item__trailing-visual--check_1nie0_82{color:var(--button-bg)}._menu-item__middle_1nie0_85{align-self:stretch;flex:1 0 0;min-width:0;display:flex;flex-direction:column;gap:var(--menu-item-label-gap, var(--spacing-xxxs));align-items:flex-start;justify-content:center;padding-top:var(--spacing-xxxxs);padding-bottom:var(--spacing-xxxxs)}._menu-item__top-row_1nie0_97{display:flex;gap:var(--spacing-xs);align-items:center;padding-inline:var(--spacing-xxxs);width:100%;flex-shrink:0}._menu-item__label_1nie0_105{font-size:var(--font-size-100);line-height:var(--line-height-100);font-weight:var(--font-weight-regular);white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis}._menu-item__secondary-label-inline_1nie0_114{font-size:var(--font-size-75);line-height:var(--line-height-75);font-weight:var(--font-weight-regular);opacity:.75;white-space:nowrap;flex-shrink:0}._menu-item__bottom-row_1nie0_122{display:flex;align-items:center;padding:0 var(--spacing-xxxs) var(--spacing-xxxxs);width:100%;flex-shrink:0}._menu-item__secondary-label-below_1nie0_129{display:flex;align-items:center;font-size:var(--font-size-75);line-height:var(--line-height-75);font-weight:var(--font-weight-regular);opacity:.75;flex:1 0 0;min-width:0;text-align:left}._menu-item__custom-status_1nie0_140{display:flex;align-items:center;font-size:var(--font-size-200);line-height:1;flex-shrink:0;opacity:.8;-webkit-user-select:none;user-select:none}._menu-item__right_1nie0_149{align-self:center;display:flex;align-items:center;justify-content:flex-end;flex-shrink:0;height:var(--spacing-xxl)}._menu-item--destructive_1nie0_157,._menu-item--destructive_1nie0_157 ._menu-item__leading-visual_1nie0_30,._menu-item--destructive_1nie0_157 ._menu-item__trailing-visual_1nie0_31,._menu-item--destructive_1nie0_157 ._menu-item__trailing-visual_1nie0_31 kbd{color:var(--error-text, var(--color-danger))}._menu-item--destructive_1nie0_157:hover:not(:disabled){background-color:var(--error-text, var(--color-danger));color:var(--button-color)}._menu-item--destructive_1nie0_157:hover:not(:disabled) ._menu-item__leading-visual_1nie0_30,._menu-item--destructive_1nie0_157:hover:not(:disabled) ._menu-item__trailing-visual_1nie0_31,._menu-item--destructive_1nie0_157:hover:not(:disabled) ._menu-item__trailing-visual_1nie0_31 kbd{color:inherit}._menu-item--destructive_1nie0_157:active:not(:disabled){background:linear-gradient(0deg,rgba(var(--button-color-rgb),.1),rgba(var(--button-color-rgb),.1)),var(--error-text, var(--color-danger));color:var(--button-color)}._menu-item--destructive_1nie0_157:active:not(:disabled) ._menu-item__leading-visual_1nie0_30,._menu-item--destructive_1nie0_157:active:not(:disabled) ._menu-item__trailing-visual_1nie0_31,._menu-item--destructive_1nie0_157:active:not(:disabled) ._menu-item__trailing-visual_1nie0_31 kbd{color:inherit}._menu-item--destructive_1nie0_157:focus-visible{background-color:var(--error-text, var(--color-danger));box-shadow:inset 0 0 0 2px rgba(var(--button-color-rgb),.6);color:var(--button-color)}._menu-item--destructive_1nie0_157:focus-visible ._menu-item__leading-visual_1nie0_30,._menu-item--destructive_1nie0_157:focus-visible ._menu-item__trailing-visual_1nie0_31,._menu-item--destructive_1nie0_157:focus-visible ._menu-item__trailing-visual_1nie0_31 kbd{color:inherit}
|
|
@@ -7,7 +7,12 @@ export interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
7
7
|
secondaryLabel?: ReactNode;
|
|
8
8
|
/** Where the secondary label appears. Default: 'below'. */
|
|
9
9
|
secondaryLabelPosition?: 'inline' | 'below';
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Custom content for the leading slot. When omitted, shows placeholder icon.
|
|
12
|
+
* When passing an icon, use `<Icon glyph={<SomeIcon />} />` — MenuItem provides
|
|
13
|
+
* the correct size via context. A 24px avatar (User Avatar or Team Avatar)
|
|
14
|
+
* fills the same slot as that icon, so the label stays on the same line.
|
|
15
|
+
*/
|
|
11
16
|
leadingVisual?: ReactNode;
|
|
12
17
|
/** Show the leading visual slot. Default: true. */
|
|
13
18
|
leadingElement?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../src/components/menu-item/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,MAAM,WAAW,aAAc,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC5E,4EAA4E;IAC5E,KAAK,EAAE,SAAS,CAAC;IACjB,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,EAAc,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,MAAM,WAAW,aAAc,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC5E,4EAA4E;IAC5E,KAAK,EAAE,SAAS,CAAC;IACjB,gCAAgC;IAChC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,2DAA2D;IAC3D,sBAAsB,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC5C;;;;;OAKG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,mDAAmD;IACnD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kNAAkN;IAClN,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,yCAAyC;IACzC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,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;;;;;;;;;GASG;AACH,MAAM,MAAM,kBAAkB,GAC1B,IAAI,GACJ,MAAM,GACN,eAAe,GACf,WAAW,GACX,OAAO,GACP,gBAAgB,GAChB,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,GACT,aAAa,GACb,cAAc,GACd,aAAa,CAAC;AAElB;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,CAClC,KAAK,SAAS,MAAM,aAAa,GAAG,kBAAkB,IACpD,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,GAAG,cAAc,CAAC;AAEzD;;;GAGG;AACH,QAAA,MAAM,QAAQ,6GAsGZ,CAAC;AAIH,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sources":["../../../src/components/menu-item/MenuItem.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type 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 { IconSlotContext } from '@/components/icon/Icon';\nimport Tag from '@/components/tag/Tag';\nimport MentionBadge from '@/components/mention-badge/MentionBadge';\nimport type { DataAttributes } from '@/utils/props';\nimport styles from './MenuItem.module.scss';\n\nexport interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Primary label. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n label: ReactNode;\n /** Optional secondary label. */\n secondaryLabel?: ReactNode;\n /** Where the secondary label appears. Default: 'below'. */\n secondaryLabelPosition?: 'inline' | 'below';\n
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sources":["../../../src/components/menu-item/MenuItem.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type 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 { IconSlotContext } from '@/components/icon/Icon';\nimport Tag from '@/components/tag/Tag';\nimport MentionBadge from '@/components/mention-badge/MentionBadge';\nimport type { DataAttributes } from '@/utils/props';\nimport styles from './MenuItem.module.scss';\n\nexport interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Primary label. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n label: ReactNode;\n /** Optional secondary label. */\n secondaryLabel?: ReactNode;\n /** Where the secondary label appears. Default: 'below'. */\n secondaryLabelPosition?: 'inline' | 'below';\n /**\n * Custom content for the leading slot. When omitted, shows placeholder icon.\n * When passing an icon, use `<Icon glyph={<SomeIcon />} />` — MenuItem provides\n * the correct size via context. A 24px avatar (User Avatar or Team Avatar)\n * fills the same slot as that icon, so the label stays on the same line.\n */\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 />} />` — MenuItem provides the correct size via context. */\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 /** Text of the `tag`. Default: \"NEW\". */\n tagLabel?: ReactNode;\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 * Props a host menu (`Combobox`, `Select`) can set itself on a row: ARIA and\n * selection state, keyboard / pointer handling, and the values it reads from the\n * option object (`label`, `secondaryLabel`, `leadingVisual`, `disabled`). They\n * can't be overridden through `menuItemProps`. This is the full set; each host\n * sets only some of the handlers (`Combobox` uses `onClick`, `Select` uses\n * `onPointerUp`) and passes the other one through. `autoFocus` is excluded too:\n * the host keeps focus on its input / trigger, and a row that grabs focus on\n * mount would take it away.\n */\nexport type MenuItemOwnedProps =\n | 'id'\n | 'role'\n | 'aria-selected'\n | 'autoFocus'\n | 'label'\n | 'secondaryLabel'\n | 'leadingVisual'\n | 'leadingElement'\n | 'trailingElement'\n | 'disabled'\n | 'active'\n | 'children'\n | 'onClick'\n | 'onMouseDown'\n | 'onMouseEnter'\n | 'onPointerUp';\n\n/**\n * Every `MenuItem` prop a host menu doesn't own (`secondaryLabelPosition`,\n * `trailingVisual`, `tag`, `mentionCount`, `destructive`, `className`, …), so\n * props added to `MenuItem` reach `Combobox` / `Select` rows automatically.\n * `Owned` is the set the host sets itself (default: all of `MenuItemOwnedProps`);\n * a host narrows it so the handlers it doesn't supply can still be passed.\n */\nexport type MenuItemPassthroughProps<\n Owned extends keyof MenuItemProps = MenuItemOwnedProps,\n> = Partial<Omit<MenuItemProps, Owned>> & DataAttributes;\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 */\nconst MenuItem = forwardRef<HTMLButtonElement, MenuItemProps>(function MenuItem(\n {\n label,\n secondaryLabel,\n secondaryLabelPosition = 'below',\n leadingVisual,\n leadingElement = true,\n trailingVisual,\n trailingElement = false,\n customStatusEmoji,\n tag = false,\n tagLabel = 'NEW',\n mentionCount,\n destructive = false,\n active = false,\n className = '',\n disabled,\n type = 'button',\n ...rest\n },\n ref,\n) {\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\n ref={ref}\n className={rootClass}\n type={type}\n disabled={disabled}\n {...rest}\n >\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 <IconSlotContext.Provider value={{ size: '16' }}>\n {leadingVisual ?? (\n <Icon glyph={<EmoticonHappyOutlineIcon />} size=\"16\" />\n )}\n </IconSlotContext.Provider>\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={tagLabel} />}\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 <IconSlotContext.Provider value={{ size: '16' }}>\n {trailingVisual ?? <Icon glyph={<CheckIcon />} size=\"16\" />}\n </IconSlotContext.Provider>\n </span>\n </div>\n )}\n </div>\n </button>\n );\n});\n\nMenuItem.displayName = 'MenuItem';\n\nexport default MenuItem;\n"],"names":["MenuItem","forwardRef","label","secondaryLabel","secondaryLabelPosition","leadingVisual","leadingElement","trailingVisual","trailingElement","customStatusEmoji","tag","tagLabel","mentionCount","destructive","active","className","disabled","type","rest","ref","rootClass","styles","jsx","jsxs","IconSlotContext","Icon","EmoticonHappyOutlineIcon","Tag","MentionBadge","CheckIcon"],"mappings":";;;;;;;;AAuFA,MAAMA,IAAWC,EAA6C,SAC5D;AAAA,EACE,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,UAAAC,IAAW;AAAA,EACX,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAY;AAAA,IAChBC,EAAO,WAAW;AAAA,IAClBR,IAAcQ,EAAO,wBAAwB,IAAI;AAAA,IACjDP,IAASO,EAAO,mBAAmB,IAAI;AAAA,IACvCN;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,WAAWC;AAAA,MACX,MAAAH;AAAA,MACA,UAAAD;AAAA,MACC,GAAGE;AAAA,MAEJ,UAAA,gBAAAK,EAAC,OAAA,EAAI,WAAWF,EAAO,oBAAoB,GACxC,UAAA;AAAA,QAAAf,KACC,gBAAAgB,EA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ACC,WAAW;AAAA,cACTD,EAAO,4BAA4B;AAAA,cAClCd,IAEG,KADAc,EAAO,mCAAmC;AAAA,YAC1C,EAEH,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,YAEX,4BAACG,EAAgB,UAAhB,EAAyB,OAAO,EAAE,MAAM,KAAA,GACtC,UAAAjB,KAAkB,gBAAAe,EAACG,KAAK,OAAO,gBAAAH,EAACO,KAAU,GAAI,MAAK,MAAK,EAAA,CAC3D;AAAA,UAAA;AAAA,QAAA,EACF,CACF;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AAED7B,EAAS,cAAc;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./MenuItem.css');const e={"menu-item":"_menu-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./MenuItem.css');const e={"menu-item":"_menu-item_1nie0_2","menu-item--active":"_menu-item--active_1nie0_27","menu-item__leading-visual":"_menu-item__leading-visual_1nie0_30","menu-item__trailing-visual":"_menu-item__trailing-visual_1nie0_31","menu-item__content":"_menu-item__content_1nie0_44","menu-item__left":"_menu-item__left_1nie0_53","menu-item__trailing-visual--check":"_menu-item__trailing-visual--check_1nie0_82","menu-item__middle":"_menu-item__middle_1nie0_85","menu-item__top-row":"_menu-item__top-row_1nie0_97","menu-item__label":"_menu-item__label_1nie0_105","menu-item__secondary-label-inline":"_menu-item__secondary-label-inline_1nie0_114","menu-item__bottom-row":"_menu-item__bottom-row_1nie0_122","menu-item__secondary-label-below":"_menu-item__secondary-label-below_1nie0_129","menu-item__custom-status":"_menu-item__custom-status_1nie0_140","menu-item__right":"_menu-item__right_1nie0_149","menu-item--destructive":"_menu-item--destructive_1nie0_157"};exports.default=e;
|
|
2
2
|
//# sourceMappingURL=MenuItem.module.scss.cjs.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import './MenuItem.css';const
|
|
2
|
-
"menu-item": "_menu-
|
|
3
|
-
"menu-item--active": "_menu-item--
|
|
4
|
-
"menu-item__leading-visual": "_menu-item__leading-
|
|
5
|
-
"menu-item__trailing-visual": "_menu-item__trailing-
|
|
6
|
-
"menu-item__content": "_menu-
|
|
7
|
-
"menu-item__left": "_menu-
|
|
8
|
-
"menu-item__trailing-visual--check": "_menu-item__trailing-visual--
|
|
9
|
-
"menu-item__middle": "_menu-
|
|
10
|
-
"menu-item__top-row": "_menu-item__top-
|
|
11
|
-
"menu-item__label": "_menu-
|
|
12
|
-
"menu-item__secondary-label-inline": "_menu-item__secondary-label-
|
|
13
|
-
"menu-item__bottom-row": "_menu-item__bottom-
|
|
14
|
-
"menu-item__secondary-label-below": "_menu-item__secondary-label-
|
|
15
|
-
"menu-item__custom-status": "_menu-item__custom-
|
|
16
|
-
"menu-item__right": "_menu-
|
|
17
|
-
"menu-item--destructive": "_menu-item--
|
|
1
|
+
import './MenuItem.css';const e = {
|
|
2
|
+
"menu-item": "_menu-item_1nie0_2",
|
|
3
|
+
"menu-item--active": "_menu-item--active_1nie0_27",
|
|
4
|
+
"menu-item__leading-visual": "_menu-item__leading-visual_1nie0_30",
|
|
5
|
+
"menu-item__trailing-visual": "_menu-item__trailing-visual_1nie0_31",
|
|
6
|
+
"menu-item__content": "_menu-item__content_1nie0_44",
|
|
7
|
+
"menu-item__left": "_menu-item__left_1nie0_53",
|
|
8
|
+
"menu-item__trailing-visual--check": "_menu-item__trailing-visual--check_1nie0_82",
|
|
9
|
+
"menu-item__middle": "_menu-item__middle_1nie0_85",
|
|
10
|
+
"menu-item__top-row": "_menu-item__top-row_1nie0_97",
|
|
11
|
+
"menu-item__label": "_menu-item__label_1nie0_105",
|
|
12
|
+
"menu-item__secondary-label-inline": "_menu-item__secondary-label-inline_1nie0_114",
|
|
13
|
+
"menu-item__bottom-row": "_menu-item__bottom-row_1nie0_122",
|
|
14
|
+
"menu-item__secondary-label-below": "_menu-item__secondary-label-below_1nie0_129",
|
|
15
|
+
"menu-item__custom-status": "_menu-item__custom-status_1nie0_140",
|
|
16
|
+
"menu-item__right": "_menu-item__right_1nie0_149",
|
|
17
|
+
"menu-item--destructive": "_menu-item--destructive_1nie0_157"
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
e as default
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=MenuItem.module.scss.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),j=require("react"),$=require("../../hooks/use-modal-focus.cjs"),A=require("../../hooks/use-popover-transition.cjs"),D=require("../scrollbar/Scrollbar.cjs"),G=require("../modal-footer/ModalFooter.cjs"),J=require("../modal-header/ModalHeader.cjs"),Q=require("../../utils/string.cjs"),U=require("../../utils/useOnExited.cjs"),e=require("./Modal.module.scss.cjs");function V({className:o="",style:a,size:r="small",title:s,subtitle:t,subtitlePlacement:n="below",hideTitle:x=!1,showBackButton:q=!1,onBack:M,backLabel:h,backButtonProps:y,onClose:u,closeLabel:I,closeButtonProps:g,headerDivider:F=!0,headerAction:N,headerSlot:R,bodyPadding:i="default",scrollable:c=!0,children:B,footer:f,footerLeading:m,footerType:d="2-actions",footerDivider:O=!0,closeOnEscape:P=!0,manageFocus:S=!0,initialFocusRef:k,active:p,transition:_,visible:w,...z}){const b=j.useRef(null);$.useModalFocus(b,{initialFocusRef:k,closeOnEscape:P,manageFocus:S,onClose:u,active:p});const v=j.useId(),C=e.default[`modal--size-${Q.toKebab(r)}`],E=[e.default["modal__body-inner"],i==="menu"&&e.default["modal__body-inner--menu"],i==="none"&&e.default["modal__body-inner--none"],!c&&e.default["modal__body-inner--fill"]].filter(Boolean).join(" "),H=l.jsx("div",{className:E,children:B}),K=[e.default.modal__scroll,!c&&e.default["modal__scroll--fill"]].filter(Boolean).join(" "),T=f!=null||m!=null||d==="spacer-small"||d==="spacer-large";return l.jsxs("div",{...z,ref:b,tabIndex:-1,className:[e.default.modal,C,_&&e.default["modal--transition"],_&&w&&e.default["modal--visible"],o].filter(Boolean).join(" "),style:a,role:"dialog","aria-modal":"true","aria-labelledby":v,children:[l.jsx(J.default,{title:s,titleId:v,subtitle:t,subtitlePlacement:n,hideTitle:x,showBackButton:q,onBack:M,backLabel:h,backButtonProps:y,onClose:u,closeLabel:I,closeButtonProps:g,divider:F,headerAction:N,headerSlot:R}),l.jsx("div",{className:e.default.modal__body,children:l.jsx(D.default,{className:K,children:H})}),T&&l.jsx(G.default,{type:d,divider:O,leading:m,children:f})]})}function W({open:o,onExited:a,...r}){const s=o!==void 0,{mounted:t,visible:n}=A.usePopoverTransition(o??!0);return U.useOnExited(t,a,s),s&&!t?null:l.jsx(V,{...r,active:o??!0,transition:s,visible:n})}exports.default=W;
|
|
2
2
|
//# sourceMappingURL=Modal.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.cjs","sources":["../../../src/components/modal/Modal.tsx"],"sourcesContent":["import type {\n CSSProperties,\n HTMLAttributes,\n ReactNode,\n RefObject,\n} from 'react';\nimport { useEffect, useId, useRef } from 'react';\nimport { useModalFocus } from '@/hooks/use-modal-focus';\nimport { usePopoverTransition } from '@/hooks/use-popover-transition';\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 type { BuiltInButtonProps } from '@/utils/props';\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 extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'children' | 'style'\n> {\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 /** Accessible name for the back button. Default: \"Go back\". */\n backLabel?: string;\n /** Extra attributes for the back button (e.g. `data-testid`). */\n backButtonProps?: BuiltInButtonProps;\n /** Called when the × close button is clicked. */\n onClose?: () => void;\n /** Accessible name for the close button. Default: \"Close\". */\n closeLabel?: string;\n /** Extra attributes for the close button (e.g. `data-testid`). */\n closeButtonProps?: BuiltInButtonProps;\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 * Full-width slot rendered below the title row and above the header divider.\n * Accepts any ReactNode — SearchInput, Tabs, a custom toolbar, etc.\n */\n headerSlot?: 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 false, the body fills the dialog height so host panes can manage\n * their own scroll regions (settings-style layouts). Default true sizes the\n * body to its content. Overflow always uses Scrollbar (default track width).\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 * Close on Escape via a document listener while mounted. Escapes already\n * handled by an inner widget (`defaultPrevented`) are ignored. Default: true.\n */\n closeOnEscape?: boolean;\n /**\n * Initial focus, Tab trap and focus restore. Set false when the host owns\n * focus (e.g. a floating-ui `FloatingFocusManager`); pair with\n * `closeOnEscape={false}` when the host also handles Escape. Initial focus\n * and restore use the value at mount; the Tab trap follows later updates.\n * Default: true.\n */\n manageFocus?: boolean;\n /**\n * Element to focus when the modal mounts (e.g. the first form field).\n * Default: the dialog root.\n */\n initialFocusRef?: RefObject<HTMLElement | null>;\n /**\n * Controlled visibility with the Compass enter/exit transition (fade + drop from the top + subtle scale 98%→100%,\n * reverse on close, `--duration-quick`); the modal unmounts after the exit,\n * and focus is restored then. Omit to keep the mount-controlled behavior\n * (always rendered, no transition). The host still owns the state.\n */\n open?: boolean;\n /** Called after the exit transition finishes and the modal unmounts (only when `open` is controlled). */\n onExited?: () => void;\n}\n\ninterface ModalPanelState {\n active: boolean;\n transition: boolean;\n visible: boolean;\n}\n\nfunction ModalPanel({\n className = '',\n style,\n size = 'small',\n title,\n subtitle,\n subtitlePlacement = 'below',\n hideTitle = false,\n showBackButton = false,\n onBack,\n backLabel,\n backButtonProps,\n onClose,\n closeLabel,\n closeButtonProps,\n headerDivider = true,\n headerAction,\n headerSlot,\n bodyPadding = 'default',\n scrollable = true,\n children,\n footer,\n footerLeading,\n footerType = '2-actions',\n footerDivider = true,\n closeOnEscape = true,\n manageFocus = true,\n initialFocusRef,\n active,\n transition,\n visible,\n ...rest\n}: ModalProps & ModalPanelState) {\n const rootRef = useRef<HTMLDivElement>(null);\n useModalFocus(rootRef, {\n initialFocusRef,\n closeOnEscape,\n manageFocus,\n onClose,\n active,\n });\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 !scrollable && styles['modal__body-inner--fill'],\n ]\n .filter(Boolean)\n .join(' ');\n\n const bodyInner = <div className={bodyInnerClass}>{children}</div>;\n const scrollClass = [\n styles['modal__scroll'],\n !scrollable && styles['modal__scroll--fill'],\n ]\n .filter(Boolean)\n .join(' ');\n const showFooter =\n footer != null ||\n footerLeading != null ||\n footerType === 'spacer-small' ||\n footerType === 'spacer-large';\n\n return (\n <div\n {...rest}\n ref={rootRef}\n tabIndex={-1}\n className={[\n styles.modal,\n sizeClass,\n transition && styles['modal--transition'],\n transition && visible && styles['modal--visible'],\n className,\n ]\n .filter(Boolean)\n .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 backLabel={backLabel}\n backButtonProps={backButtonProps}\n onClose={onClose}\n closeLabel={closeLabel}\n closeButtonProps={closeButtonProps}\n divider={headerDivider}\n headerAction={headerAction}\n headerSlot={headerSlot}\n />\n\n <div className={styles['modal__body']}>\n <Scrollbar className={scrollClass}>{bodyInner}</Scrollbar>\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\n/**\n * Modal dialog shell — composes ModalHeader, scrollable body, and ModalFooter.\n * Owns dialog-level focus and keyboard behavior: initial focus, Tab trap,\n * Escape, and focus restore on unmount. Host owns portal, overlay/backdrop,\n * scroll lock, stacking, and open state. Mount-controlled by default; pass\n * `open` for the enter/exit transition.\n */\nexport default function Modal({ open, onExited, ...props }: ModalProps) {\n const controlled = open !== undefined;\n const { mounted, visible } = usePopoverTransition(open ?? true);\n const wasMounted = useRef(mounted);\n const onExitedRef = useRef(onExited);\n onExitedRef.current = onExited;\n\n useEffect(() => {\n if (wasMounted.current && !mounted && controlled) {\n onExitedRef.current?.();\n }\n wasMounted.current = mounted;\n }, [mounted, controlled]);\n\n if (controlled && !mounted) return null;\n\n return (\n <ModalPanel\n {...props}\n active={open ?? true}\n transition={controlled}\n visible={visible}\n />\n );\n}\n"],"names":["ModalPanel","className","style","size","title","subtitle","subtitlePlacement","hideTitle","showBackButton","onBack","backLabel","backButtonProps","onClose","closeLabel","closeButtonProps","headerDivider","headerAction","headerSlot","bodyPadding","scrollable","children","footer","footerLeading","footerType","footerDivider","closeOnEscape","manageFocus","initialFocusRef","active","transition","visible","rest","rootRef","useRef","useModalFocus","titleId","useId","sizeClass","styles","toKebab","bodyInnerClass","bodyInner","jsx","scrollClass","showFooter","jsxs","ModalHeader","Scrollbar","ModalFooter","Modal","open","onExited","props","controlled","mounted","usePopoverTransition","wasMounted","onExitedRef","useEffect","_a"],"mappings":"0cAiIA,SAASA,EAAW,CAClB,UAAAC,EAAY,GACZ,MAAAC,EACA,KAAAC,EAAO,QACP,MAAAC,EACA,SAAAC,EACA,kBAAAC,EAAoB,QACpB,UAAAC,EAAY,GACZ,eAAAC,EAAiB,GACjB,OAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,WAAAC,EACA,iBAAAC,EACA,cAAAC,EAAgB,GAChB,aAAAC,EACA,WAAAC,EACA,YAAAC,EAAc,UACd,WAAAC,EAAa,GACb,SAAAC,EACA,OAAAC,EACA,cAAAC,EACA,WAAAC,EAAa,YACb,cAAAC,EAAgB,GAChB,cA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OAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,WAAAC,EACA,iBAAAC,EACA,QAASC,EACT,aAAAC,EACA,WAAAC,CAAA,CAAA,EAGFyB,EAAAA,IAAC,MAAA,CAAI,UAAWJ,EAAAA,QAAO,YACrB,SAAAI,EAAAA,IAACK,EAAAA,QAAA,CAAU,UAAWJ,EAAc,SAAAF,CAAA,CAAU,EAChD,EAECG,GACCF,EAAAA,IAACM,EAAAA,QAAA,CACC,KAAMzB,EACN,QAASC,EACT,QAASF,EAER,SAAAD,CAAA,CAAA,CACH,CAAA,CAAA,CAIR,CASA,SAAwB4B,EAAM,CAAE,KAAAC,EAAM,SAAAC,EAAU,GAAGC,GAAqB,CACtE,MAAMC,EAAaH,IAAS,OACtB,CAAE,QAAAI,EAAS,QAAAxB,CAAA,EAAYyB,EAAAA,qBAAqBL,GAAQ,EAAI,EACxDM,EAAavB,EAAAA,OAAOqB,CAAO,EAC3BG,EAAcxB,EAAAA,OAAOkB,CAAQ,EAUnC,OATAM,EAAY,QAAUN,EAEtBO,EAAAA,UAAU,IAAM,OACVF,EAAW,SAAW,CAACF,GAAWD,KACpCM,EAAAF,EAAY,UAAZ,MAAAE,EAAA,KAAAF,IAEFD,EAAW,QAAUF,CACvB,EAAG,CAACA,EAASD,CAAU,CAAC,EAEpBA,GAAc,CAACC,EAAgB,KAGjCZ,EAAAA,IAAC1C,EAAA,CACE,GAAGoD,EACJ,OAAQF,GAAQ,GAChB,WAAYG,EACZ,QAAAvB,CAAA,CAAA,CAGN"}
|
|
1
|
+
{"version":3,"file":"Modal.cjs","sources":["../../../src/components/modal/Modal.tsx"],"sourcesContent":["import type {\n CSSProperties,\n HTMLAttributes,\n ReactNode,\n RefObject,\n} from 'react';\nimport { useId, useRef } from 'react';\nimport { useModalFocus } from '@/hooks/use-modal-focus';\nimport { usePopoverTransition } from '@/hooks/use-popover-transition';\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 type { BuiltInButtonProps } from '@/utils/props';\nimport { toKebab } from '@/utils/string';\nimport { useOnExited } from '@/utils/useOnExited';\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 extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'children' | 'style'\n> {\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 /** Accessible name for the back button. Default: \"Go back\". */\n backLabel?: string;\n /** Extra attributes for the back button (e.g. `data-testid`). */\n backButtonProps?: BuiltInButtonProps;\n /** Called when the × close button is clicked. */\n onClose?: () => void;\n /** Accessible name for the close button. Default: \"Close\". */\n closeLabel?: string;\n /** Extra attributes for the close button (e.g. `data-testid`). */\n closeButtonProps?: BuiltInButtonProps;\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 * Full-width slot rendered below the title row and above the header divider.\n * Accepts any ReactNode — SearchInput, Tabs, a custom toolbar, etc.\n */\n headerSlot?: 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 false, the body fills the dialog height so host panes can manage\n * their own scroll regions (settings-style layouts). Default true sizes the\n * body to its content. Overflow always uses Scrollbar (default track width).\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 * Close on Escape via a document listener while mounted. Escapes already\n * handled by an inner widget (`defaultPrevented`) are ignored. Default: true.\n */\n closeOnEscape?: boolean;\n /**\n * Initial focus, Tab trap and focus restore. Set false when the host owns\n * focus (e.g. a floating-ui `FloatingFocusManager`); pair with\n * `closeOnEscape={false}` when the host also handles Escape. Initial focus\n * and restore use the value at mount; the Tab trap follows later updates.\n * Default: true.\n */\n manageFocus?: boolean;\n /**\n * Element to focus when the modal mounts (e.g. the first form field).\n * Default: the dialog root.\n */\n initialFocusRef?: RefObject<HTMLElement | null>;\n /**\n * Controlled visibility with the Compass enter/exit transition (fade + drop from the top + subtle scale 98%→100%,\n * reverse on close, `--duration-quick`); the modal unmounts after the exit,\n * and focus is restored then. Omit to keep the mount-controlled behavior\n * (always rendered, no transition). The host still owns the state.\n */\n open?: boolean;\n /** Called after the exit transition finishes and the modal unmounts (only when `open` is controlled). */\n onExited?: () => void;\n}\n\ninterface ModalPanelState {\n active: boolean;\n transition: boolean;\n visible: boolean;\n}\n\nfunction ModalPanel({\n className = '',\n style,\n size = 'small',\n title,\n subtitle,\n subtitlePlacement = 'below',\n hideTitle = false,\n showBackButton = false,\n onBack,\n backLabel,\n backButtonProps,\n onClose,\n closeLabel,\n closeButtonProps,\n headerDivider = true,\n headerAction,\n headerSlot,\n bodyPadding = 'default',\n scrollable = true,\n children,\n footer,\n footerLeading,\n footerType = '2-actions',\n footerDivider = true,\n closeOnEscape = true,\n manageFocus = true,\n initialFocusRef,\n active,\n transition,\n visible,\n ...rest\n}: ModalProps & ModalPanelState) {\n const rootRef = useRef<HTMLDivElement>(null);\n useModalFocus(rootRef, {\n initialFocusRef,\n closeOnEscape,\n manageFocus,\n onClose,\n active,\n });\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 !scrollable && styles['modal__body-inner--fill'],\n ]\n .filter(Boolean)\n .join(' ');\n\n const bodyInner = <div className={bodyInnerClass}>{children}</div>;\n const scrollClass = [\n styles['modal__scroll'],\n !scrollable && styles['modal__scroll--fill'],\n ]\n .filter(Boolean)\n .join(' ');\n const showFooter =\n footer != null ||\n footerLeading != null ||\n footerType === 'spacer-small' ||\n footerType === 'spacer-large';\n\n return (\n <div\n {...rest}\n ref={rootRef}\n tabIndex={-1}\n className={[\n styles.modal,\n sizeClass,\n transition && styles['modal--transition'],\n transition && visible && styles['modal--visible'],\n className,\n ]\n .filter(Boolean)\n .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 backLabel={backLabel}\n backButtonProps={backButtonProps}\n onClose={onClose}\n closeLabel={closeLabel}\n closeButtonProps={closeButtonProps}\n divider={headerDivider}\n headerAction={headerAction}\n headerSlot={headerSlot}\n />\n\n <div className={styles['modal__body']}>\n <Scrollbar className={scrollClass}>{bodyInner}</Scrollbar>\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\n/**\n * Modal dialog shell — composes ModalHeader, scrollable body, and ModalFooter.\n * Owns dialog-level focus and keyboard behavior: initial focus, Tab trap,\n * Escape, and focus restore on unmount. Host owns portal, overlay/backdrop,\n * scroll lock, stacking, and open state. Mount-controlled by default; pass\n * `open` for the enter/exit transition.\n */\nexport default function Modal({ open, onExited, ...props }: ModalProps) {\n const controlled = open !== undefined;\n const { mounted, visible } = usePopoverTransition(open ?? true);\n useOnExited(mounted, onExited, controlled);\n\n if (controlled && !mounted) return null;\n\n return (\n <ModalPanel\n {...props}\n active={open ?? true}\n transition={controlled}\n visible={visible}\n />\n );\n}\n"],"names":["ModalPanel","className","style","size","title","subtitle","subtitlePlacement","hideTitle","showBackButton","onBack","backLabel","backButtonProps","onClose","closeLabel","closeButtonProps","headerDivider","headerAction","headerSlot","bodyPadding","scrollable","children","footer","footerLeading","footerType","footerDivider","closeOnEscape","manageFocus","initialFocusRef","active","transition","visible","rest","rootRef","useRef","useModalFocus","titleId","useId","sizeClass","styles","toKebab","bodyInnerClass","bodyInner","jsx","scrollClass","showFooter","jsxs","ModalHeader","Scrollbar","ModalFooter","Modal","open","onExited","props","controlled","mounted","usePopoverTransition","useOnExited"],"mappings":"mfAkIA,SAASA,EAAW,CAClB,UAAAC,EAAY,GACZ,MAAAC,EACA,KAAAC,EAAO,QACP,MAAAC,EACA,SAAAC,EACA,kBAAAC,EAAoB,QACpB,UAAAC,EAAY,GACZ,eAAAC,EAAiB,GACjB,OAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,WAAAC,EACA,iBAAAC,EACA,cAAAC,EAAgB,GAChB,aAAAC,EACA,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jB,SAAA,CAAAO,EAAAA,IAACI,EAAAA,QAAA,CACC,MAAA1C,EACA,QAAA+B,EACA,SAAA9B,EACA,kBAAAC,EACA,UAAAC,EACA,eAAAC,EACA,OAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,WAAAC,EACA,iBAAAC,EACA,QAASC,EACT,aAAAC,EACA,WAAAC,CAAA,CAAA,EAGFyB,EAAAA,IAAC,MAAA,CAAI,UAAWJ,EAAAA,QAAO,YACrB,SAAAI,EAAAA,IAACK,EAAAA,QAAA,CAAU,UAAWJ,EAAc,SAAAF,CAAA,CAAU,EAChD,EAECG,GACCF,EAAAA,IAACM,EAAAA,QAAA,CACC,KAAMzB,EACN,QAASC,EACT,QAASF,EAER,SAAAD,CAAA,CAAA,CACH,CAAA,CAAA,CAIR,CASA,SAAwB4B,EAAM,CAAE,KAAAC,EAAM,SAAAC,EAAU,GAAGC,GAAqB,CACtE,MAAMC,EAAaH,IAAS,OACtB,CAAE,QAAAI,EAAS,QAAAxB,CAAA,EAAYyB,EAAAA,qBAAqBL,GAAQ,EAAI,EAG9D,OAFAM,cAAYF,EAASH,EAAUE,CAAU,EAErCA,GAAc,CAACC,EAAgB,KAGjCZ,EAAAA,IAAC1C,EAAA,CACE,GAAGoD,EACJ,OAAQF,GAAQ,GAChB,WAAYG,EACZ,QAAAvB,CAAA,CAAA,CAGN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,SAAS,EACT,SAAS,EACV,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
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
|
|
7
|
-
import
|
|
8
|
-
import { toKebab as
|
|
1
|
+
import { jsx as l, jsxs as q } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as A, useId as D } from "react";
|
|
3
|
+
import { useModalFocus as G } from "../../hooks/use-modal-focus.js";
|
|
4
|
+
import { usePopoverTransition as J } from "../../hooks/use-popover-transition.js";
|
|
5
|
+
import Q from "../scrollbar/Scrollbar.js";
|
|
6
|
+
import U from "../modal-footer/ModalFooter.js";
|
|
7
|
+
import V from "../modal-header/ModalHeader.js";
|
|
8
|
+
import { toKebab as W } from "../../utils/string.js";
|
|
9
|
+
import { useOnExited as X } from "../../utils/useOnExited.js";
|
|
9
10
|
import o from "./Modal.module.scss.js";
|
|
10
|
-
function
|
|
11
|
-
className:
|
|
12
|
-
style:
|
|
13
|
-
size:
|
|
11
|
+
function Y({
|
|
12
|
+
className: e = "",
|
|
13
|
+
style: n,
|
|
14
|
+
size: i = "small",
|
|
14
15
|
title: r,
|
|
15
|
-
subtitle:
|
|
16
|
-
subtitlePlacement:
|
|
17
|
-
hideTitle:
|
|
18
|
-
showBackButton:
|
|
19
|
-
onBack:
|
|
16
|
+
subtitle: a,
|
|
17
|
+
subtitlePlacement: t = "below",
|
|
18
|
+
hideTitle: v = !1,
|
|
19
|
+
showBackButton: y = !1,
|
|
20
|
+
onBack: h,
|
|
20
21
|
backLabel: j,
|
|
21
|
-
backButtonProps:
|
|
22
|
-
onClose:
|
|
23
|
-
closeLabel:
|
|
24
|
-
closeButtonProps:
|
|
25
|
-
headerDivider:
|
|
26
|
-
headerAction:
|
|
27
|
-
headerSlot:
|
|
28
|
-
bodyPadding:
|
|
29
|
-
scrollable:
|
|
30
|
-
children:
|
|
31
|
-
footer:
|
|
32
|
-
footerLeading:
|
|
33
|
-
footerType:
|
|
34
|
-
footerDivider:
|
|
35
|
-
closeOnEscape:
|
|
36
|
-
manageFocus:
|
|
37
|
-
initialFocusRef:
|
|
38
|
-
active:
|
|
39
|
-
transition:
|
|
40
|
-
visible:
|
|
41
|
-
...
|
|
22
|
+
backButtonProps: x,
|
|
23
|
+
onClose: d,
|
|
24
|
+
closeLabel: I,
|
|
25
|
+
closeButtonProps: M,
|
|
26
|
+
headerDivider: N = !0,
|
|
27
|
+
headerAction: B,
|
|
28
|
+
headerSlot: F,
|
|
29
|
+
bodyPadding: m = "default",
|
|
30
|
+
scrollable: c = !0,
|
|
31
|
+
children: w,
|
|
32
|
+
footer: u,
|
|
33
|
+
footerLeading: f,
|
|
34
|
+
footerType: s = "2-actions",
|
|
35
|
+
footerDivider: z = !0,
|
|
36
|
+
closeOnEscape: C = !0,
|
|
37
|
+
manageFocus: R = !0,
|
|
38
|
+
initialFocusRef: g,
|
|
39
|
+
active: E,
|
|
40
|
+
transition: b,
|
|
41
|
+
visible: H,
|
|
42
|
+
...K
|
|
42
43
|
}) {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
initialFocusRef:
|
|
46
|
-
closeOnEscape:
|
|
47
|
-
manageFocus:
|
|
48
|
-
onClose:
|
|
49
|
-
active:
|
|
44
|
+
const _ = A(null);
|
|
45
|
+
G(_, {
|
|
46
|
+
initialFocusRef: g,
|
|
47
|
+
closeOnEscape: C,
|
|
48
|
+
manageFocus: R,
|
|
49
|
+
onClose: d,
|
|
50
|
+
active: E
|
|
50
51
|
});
|
|
51
|
-
const
|
|
52
|
+
const p = D(), O = o[`modal--size-${W(i)}`], P = [
|
|
52
53
|
o["modal__body-inner"],
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
!
|
|
56
|
-
].filter(Boolean).join(" "),
|
|
54
|
+
m === "menu" && o["modal__body-inner--menu"],
|
|
55
|
+
m === "none" && o["modal__body-inner--none"],
|
|
56
|
+
!c && o["modal__body-inner--fill"]
|
|
57
|
+
].filter(Boolean).join(" "), S = /* @__PURE__ */ l("div", { className: P, children: w }), $ = [
|
|
57
58
|
o.modal__scroll,
|
|
58
|
-
!
|
|
59
|
-
].filter(Boolean).join(" "),
|
|
60
|
-
return /* @__PURE__ */
|
|
59
|
+
!c && o["modal__scroll--fill"]
|
|
60
|
+
].filter(Boolean).join(" "), k = u != null || f != null || s === "spacer-small" || s === "spacer-large";
|
|
61
|
+
return /* @__PURE__ */ q(
|
|
61
62
|
"div",
|
|
62
63
|
{
|
|
63
|
-
...
|
|
64
|
-
ref:
|
|
64
|
+
...K,
|
|
65
|
+
ref: _,
|
|
65
66
|
tabIndex: -1,
|
|
66
67
|
className: [
|
|
67
68
|
o.modal,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
O,
|
|
70
|
+
b && o["modal--transition"],
|
|
71
|
+
b && H && o["modal--visible"],
|
|
72
|
+
e
|
|
72
73
|
].filter(Boolean).join(" "),
|
|
73
|
-
style:
|
|
74
|
+
style: n,
|
|
74
75
|
role: "dialog",
|
|
75
76
|
"aria-modal": "true",
|
|
76
|
-
"aria-labelledby":
|
|
77
|
+
"aria-labelledby": p,
|
|
77
78
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
79
|
+
/* @__PURE__ */ l(
|
|
80
|
+
V,
|
|
80
81
|
{
|
|
81
82
|
title: r,
|
|
82
|
-
titleId:
|
|
83
|
-
subtitle:
|
|
84
|
-
subtitlePlacement:
|
|
85
|
-
hideTitle:
|
|
86
|
-
showBackButton:
|
|
87
|
-
onBack:
|
|
83
|
+
titleId: p,
|
|
84
|
+
subtitle: a,
|
|
85
|
+
subtitlePlacement: t,
|
|
86
|
+
hideTitle: v,
|
|
87
|
+
showBackButton: y,
|
|
88
|
+
onBack: h,
|
|
88
89
|
backLabel: j,
|
|
89
|
-
backButtonProps:
|
|
90
|
-
onClose:
|
|
91
|
-
closeLabel:
|
|
92
|
-
closeButtonProps:
|
|
93
|
-
divider:
|
|
94
|
-
headerAction:
|
|
95
|
-
headerSlot:
|
|
90
|
+
backButtonProps: x,
|
|
91
|
+
onClose: d,
|
|
92
|
+
closeLabel: I,
|
|
93
|
+
closeButtonProps: M,
|
|
94
|
+
divider: N,
|
|
95
|
+
headerAction: B,
|
|
96
|
+
headerSlot: F
|
|
96
97
|
}
|
|
97
98
|
),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
/* @__PURE__ */ l("div", { className: o.modal__body, children: /* @__PURE__ */ l(Q, { className: $, children: S }) }),
|
|
100
|
+
k && /* @__PURE__ */ l(
|
|
101
|
+
U,
|
|
101
102
|
{
|
|
102
|
-
type:
|
|
103
|
-
divider:
|
|
104
|
-
leading:
|
|
105
|
-
children:
|
|
103
|
+
type: s,
|
|
104
|
+
divider: z,
|
|
105
|
+
leading: f,
|
|
106
|
+
children: u
|
|
106
107
|
}
|
|
107
108
|
)
|
|
108
109
|
]
|
|
109
110
|
}
|
|
110
111
|
);
|
|
111
112
|
}
|
|
112
|
-
function to({ open:
|
|
113
|
-
const r =
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
s.current && !l && r && ((i = e.current) == null || i.call(e)), s.current = l;
|
|
117
|
-
}, [l, r]), r && !l ? null : /* @__PURE__ */ n(
|
|
118
|
-
Z,
|
|
113
|
+
function to({ open: e, onExited: n, ...i }) {
|
|
114
|
+
const r = e !== void 0, { mounted: a, visible: t } = J(e ?? !0);
|
|
115
|
+
return X(a, n, r), r && !a ? null : /* @__PURE__ */ l(
|
|
116
|
+
Y,
|
|
119
117
|
{
|
|
120
|
-
...
|
|
121
|
-
active:
|
|
118
|
+
...i,
|
|
119
|
+
active: e ?? !0,
|
|
122
120
|
transition: r,
|
|
123
|
-
visible:
|
|
121
|
+
visible: t
|
|
124
122
|
}
|
|
125
123
|
);
|
|
126
124
|
}
|