@fluentui-copilot/react-prompt-starter 0.10.7 → 0.10.8
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/CHANGELOG.json +36 -1
- package/CHANGELOG.md +13 -2
- package/dist/index.d.ts +48 -0
- package/lib/components/PromptStarter/PromptStarter.js +4 -1
- package/lib/components/PromptStarter/PromptStarter.js.map +1 -1
- package/lib/components/PromptStarter/PromptStarter.types.js +2 -0
- package/lib/components/PromptStarter/PromptStarter.types.js.map +1 -1
- package/lib/components/PromptStarter/renderPromptStarter.js +4 -1
- package/lib/components/PromptStarter/renderPromptStarter.js.map +1 -1
- package/lib/components/PromptStarter/usePromptStarter.js +3 -0
- package/lib/components/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.js +4 -0
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.js.map +1 -1
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.raw.js +4 -1
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +2 -2
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +58 -31
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +33 -12
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +27 -8
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/PromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/PromptStarter.types.js +2 -0
- package/lib-commonjs/components/PromptStarter/PromptStarter.types.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/renderPromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +2 -2
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +72 -34
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +33 -12
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +27 -8
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptStarterStyles.styles.ts"],"sourcesContent":["import {\n makeStyles,\n makeResetStyles,\n mergeClasses,\n shorthands,\n typographyStyles,\n createFocusOutlineStyle,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { PromptStarterSlots, PromptStarterState } from './PromptStarter.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptStarterClassNames: SlotClassNames<PromptStarterSlots> = {\n root: 'fai-PromptStarter',\n primaryAction: 'fai-PromptStarter__primaryAction',\n icon: 'fai-PromptStarter__icon',\n category: 'fai-PromptStarter__category',\n prompt: 'fai-PromptStarter__prompt',\n reasonMarker: 'fai-PromptStarter__reasonMarker',\n actions: 'fai-PromptStarter__actions',\n};\n\nconst useRootResetStyles = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: '1fr auto',\n gridTemplateRows: 'max-content auto',\n minWidth: '214px',\n\n // Apply styles to the primary action on hover / active states\n '&:hover': {\n [`& .${promptStarterClassNames.primaryAction}`]: {\n boxShadow: tokens.shadow16,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n },\n '&:active': {\n [`& .${promptStarterClassNames.primaryAction}`]: {\n boxShadow: tokens.shadow8,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n },\n\n // Hide actions when not focused or hovered\n ':not(:focus-within):not(:hover)': {\n [`& .${promptStarterClassNames.actions}`]: {\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute',\n opacity: 0,\n },\n },\n});\n\nconst useStyles = makeStyles({\n primaryAction: {\n gridRow: '1 / 3',\n gridColumn: '1 / 3',\n position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'max-content 1fr',\n gridAutoRows: 'max-content 1fr max-content',\n borderRadius: '28px',\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground2,\n fontFamily: tokens.fontFamilyBase,\n cursor: 'pointer',\n outlineStyle: 'none',\n textAlign: 'left',\n columnGap: tokens.spacingHorizontalMNudge,\n rowGap: tokens.spacingVerticalS,\n padding: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}`,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n ...createFocusOutlineStyle({ style: { outlineRadius: '28px' } }),\n },\n\n primaryActionHovered: {\n boxShadow: tokens.shadow16,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n\n icon: {\n display: 'flex',\n alignItems: 'center',\n minHeight: tokens.spacingVerticalXXL,\n gridRow: 1,\n gridColumn: '1 / 2',\n },\n category: {\n display: 'flex',\n alignItems: 'center',\n ...typographyStyles.body1Strong,\n\n gridRow: 1,\n gridColumn: '2 / 3',\n },\n actions: {\n margin: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}\n ${tokens.spacingVerticalNone} ${tokens.spacingHorizontalNone}`,\n position: 'relative',\n gridRow: '1 / 2',\n gridColumn: '2 / 3',\n\n opacity: 1,\n transition: `opacity ${tokens.durationFast} ${tokens.curveLinear}`,\n },\n actionsWithCategory: {\n // Add a background and gradient fade to truncate the title if applicable\n backgroundColor: tokens.colorNeutralBackground1,\n\n boxShadow: `-12px 0 12px 0 ${tokens.colorNeutralBackground1}`,\n },\n prompt: {\n ...typographyStyles.body1Strong,\n\n // Truncate text after two lines.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '2',\n overflowY: 'hidden',\n gridRow: '2',\n gridColumn: '1 / 3',\n },\n promptNoReasonMarker: {\n // Truncate text after three lines when no reason marker is present.\n '-webkit-line-clamp': '3',\n },\n reasonMarker: {\n gridRow: '3',\n gridColumn: '1 / 3',\n ...typographyStyles.caption2,\n },\n});\n\nconst useSingleColumnStyles = makeStyles({\n primaryAction: {\n display: 'flex',\n borderRadius: tokens.borderRadius2XL,\n ...createFocusOutlineStyle({ style: { outlineRadius: tokens.borderRadius2XL } }),\n },\n prompt: {\n ...typographyStyles.caption1Strong,\n },\n});\n\nexport const usePromptStarterStyles_unstable = (state: PromptStarterState): PromptStarterState => {\n 'use no memo';\n\n const { isSingleColumn } = state;\n\n const styles = useStyles();\n const rootResetStyles = useRootResetStyles();\n const singleColumnStyles = useSingleColumnStyles();\n state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, state.root.className);\n state.primaryAction.className = mergeClasses(\n promptStarterClassNames.primaryAction,\n styles.primaryAction,\n isSingleColumn && singleColumnStyles.primaryAction,\n state.primaryAction.className,\n );\n if (state.icon) {\n state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, state.icon.className);\n }\n if (state.category) {\n state.category.className = mergeClasses(\n promptStarterClassNames.category,\n styles.category,\n state.category.className,\n );\n }\n state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\n !state.reasonMarker && styles.promptNoReasonMarker,\n isSingleColumn && singleColumnStyles.prompt,\n state.prompt.className,\n );\n if (state.reasonMarker) {\n state.reasonMarker.className = mergeClasses(\n promptStarterClassNames.reasonMarker,\n styles.reasonMarker,\n state.reasonMarker.className,\n );\n }\n if (state.actions) {\n state.actions.className = mergeClasses(\n promptStarterClassNames.actions,\n styles.actions,\n state.category && styles.actionsWithCategory,\n state.actions.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","shorthands","typographyStyles","createFocusOutlineStyle","tokens","promptStarterClassNames","root","primaryAction","icon","category","prompt","reasonMarker","actions","useRootResetStyles","display","gridTemplateColumns","gridTemplateRows","minWidth","boxShadow","shadow16","transform","transition","durationNormal","curveDecelerateMin","shadow8","clip","height","margin","overflow","padding","width","position","opacity","useStyles","gridRow","gridColumn","gridAutoRows","borderRadius","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground2","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","columnGap","spacingHorizontalMNudge","rowGap","spacingVerticalS","spacingVerticalL","spacingHorizontalL","border","strokeWidthThin","colorNeutralStroke2","style","outlineRadius","primaryActionHovered","alignItems","minHeight","spacingVerticalXXL","body1Strong","spacingVerticalNone","spacingHorizontalNone","durationFast","curveLinear","actionsWithCategory","overflowY","promptNoReasonMarker","caption2","useSingleColumnStyles","borderRadius2XL","caption1Strong","usePromptStarterStyles_unstable","state","isSingleColumn","styles","rootResetStyles","singleColumnStyles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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IACA,IAAIL,MAAMlE,QAAQ,EAAE;QAClBkE,MAAMlE,QAAQ,CAACuE,SAAS,GAAGhF,aACzBK,wBAAwBI,QAAQ,EAChCoE,OAAOpE,QAAQ,EACfkE,MAAMlE,QAAQ,CAACuE,SAAS;IAE5B;IACAL,MAAMjE,MAAM,CAACsE,SAAS,GAAGhF,aACvBK,wBAAwBK,MAAM,EAC9BmE,OAAOnE,MAAM,EACb,CAACiE,MAAMhE,YAAY,IAAIkE,OAAOR,oBAAoB,EAClDO,kBAAkBG,mBAAmBrE,MAAM,EAC3CiE,MAAMjE,MAAM,CAACsE,SAAS;IAExB,IAAIL,MAAMhE,YAAY,EAAE;QACtBgE,MAAMhE,YAAY,CAACqE,SAAS,GAAGhF,aAC7BK,wBAAwBM,YAAY,EACpCkE,OAAOlE,YAAY,EACnBgE,MAAMhE,YAAY,CAACqE,SAAS;IAEhC;IACA,IAAIL,MAAM/D,OAAO,EAAE;QACjB+D,MAAM/D,OAAO,CAACoE,SAAS,GAAGhF,aACxBK,wBAAwBO,OAAO,EAC/BiE,OAAOjE,OAAO,EACd+D,MAAMlE,QAAQ,IAAIoE,OAAOV,mBAAmB,EAC5CQ,MAAM/D,OAAO,CAACoE,SAAS;IAE3B;IAEA,OAAOL;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["usePromptStarterStyles.styles.ts"],"sourcesContent":["import {\n makeStyles,\n makeResetStyles,\n mergeClasses,\n shorthands,\n typographyStyles,\n createFocusOutlineStyle,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { PromptStarterSlots, PromptStarterState } from './PromptStarter.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptStarterClassNames: SlotClassNames<PromptStarterSlots> = {\n root: 'fai-PromptStarter',\n primaryAction: 'fai-PromptStarter__primaryAction',\n icon: 'fai-PromptStarter__icon',\n category: 'fai-PromptStarter__category',\n prompt: 'fai-PromptStarter__prompt',\n reasonMarker: 'fai-PromptStarter__reasonMarker',\n actions: 'fai-PromptStarter__actions',\n};\n\nconst useRootResetStyles = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: '1fr auto',\n gridTemplateRows: 'max-content auto',\n minWidth: '214px',\n\n // Apply styles to the primary action on hover / active states\n '&:hover': {\n [`& .${promptStarterClassNames.primaryAction}`]: {\n boxShadow: tokens.shadow16,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n },\n '&:active': {\n [`& .${promptStarterClassNames.primaryAction}`]: {\n boxShadow: tokens.shadow8,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n },\n\n // Hide actions when not focused or hovered\n ':not(:focus-within):not(:hover)': {\n [`& .${promptStarterClassNames.actions}`]: {\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute',\n opacity: 0,\n },\n },\n});\n\nconst useStyles = makeStyles({\n primaryAction: {\n gridRow: '1 / 3',\n gridColumn: '1 / 3',\n position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'max-content 1fr',\n gridAutoRows: 'max-content 1fr max-content',\n borderRadius: '28px',\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground2,\n fontFamily: tokens.fontFamilyBase,\n cursor: 'pointer',\n outlineStyle: 'none',\n textAlign: 'left',\n columnGap: tokens.spacingHorizontalMNudge,\n rowGap: tokens.spacingVerticalS,\n padding: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}`,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n ...createFocusOutlineStyle({ style: { outlineRadius: '28px' } }),\n },\n\n primaryActionHovered: {\n boxShadow: tokens.shadow16,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n\n icon: {\n display: 'flex',\n alignItems: 'center',\n minHeight: tokens.spacingVerticalXXL,\n gridRow: 1,\n gridColumn: '1 / 2',\n },\n category: {\n gridRow: 1,\n gridColumn: '2 / 3',\n alignSelf: 'center',\n\n color: tokens.colorNeutralForeground1,\n ...typographyStyles.body1Strong,\n\n // Truncate text after one line.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '1',\n overflowY: 'hidden',\n wordBreak: 'break-word',\n },\n actions: {\n gridRow: '1 / 2',\n gridColumn: '2 / 3',\n position: 'relative',\n margin: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}\n ${tokens.spacingVerticalNone} ${tokens.spacingHorizontalNone}`,\n opacity: 1,\n transition: `opacity ${tokens.durationFast} ${tokens.curveLinear}`,\n },\n actionsWithCategory: {\n // Add a background and gradient fade to truncate the title if applicable\n backgroundColor: tokens.colorNeutralBackground1,\n\n boxShadow: `-12px 0 12px 0 ${tokens.colorNeutralBackground1}`,\n },\n prompt: {\n gridRow: '2',\n gridColumn: '1 / 3',\n\n ...typographyStyles.body1Strong,\n\n // Truncate text after two lines.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '2',\n overflowY: 'hidden',\n wordBreak: 'break-word',\n },\n promptNoReasonMarker: {\n // Truncate text after three lines when no reason marker is present.\n '-webkit-line-clamp': '3',\n },\n reasonMarker: {\n gridRow: '3',\n gridColumn: '1 / 3',\n\n ...typographyStyles.caption2,\n\n // Truncate text after one line.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '1',\n overflowY: 'hidden',\n wordBreak: 'break-word',\n },\n});\n\nconst useSingleColumnStyles = makeStyles({\n primaryAction: {\n display: 'flex',\n flexDirection: 'column',\n padding: `${tokens.spacingVerticalM} ${tokens.spacingHorizontalM}`,\n borderRadius: tokens.borderRadius2XL,\n ...createFocusOutlineStyle({ style: { outlineRadius: tokens.borderRadius2XL } }),\n },\n category: {\n ...typographyStyles.caption1Strong,\n alignSelf: 'auto',\n },\n prompt: {\n ...typographyStyles.caption1Strong,\n\n // Always truncate after two lines in single column layout.\n '-webkit-line-clamp': '2',\n },\n});\n\nexport const usePromptStarterStyles_unstable = (state: PromptStarterState): PromptStarterState => {\n 'use no memo';\n\n const { isSingleColumn } = state;\n\n const styles = useStyles();\n const rootResetStyles = useRootResetStyles();\n const singleColumnStyles = useSingleColumnStyles();\n state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, state.root.className);\n state.primaryAction.className = mergeClasses(\n promptStarterClassNames.primaryAction,\n styles.primaryAction,\n isSingleColumn && singleColumnStyles.primaryAction,\n state.primaryAction.className,\n );\n if (state.icon) {\n state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, state.icon.className);\n }\n if (state.category) {\n state.category.className = mergeClasses(\n promptStarterClassNames.category,\n styles.category,\n isSingleColumn && singleColumnStyles.category,\n state.category.className,\n );\n }\n state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\n !state.reasonMarker && styles.promptNoReasonMarker,\n isSingleColumn && singleColumnStyles.prompt,\n state.prompt.className,\n );\n if (state.reasonMarker) {\n state.reasonMarker.className = mergeClasses(\n promptStarterClassNames.reasonMarker,\n styles.reasonMarker,\n state.reasonMarker.className,\n );\n }\n if (state.actions) {\n state.actions.className = mergeClasses(\n promptStarterClassNames.actions,\n styles.actions,\n state.category && styles.actionsWithCategory,\n state.actions.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","shorthands","typographyStyles","createFocusOutlineStyle","tokens","promptStarterClassNames","root","primaryAction","icon","category","prompt","reasonMarker","actions","useRootResetStyles","display","gridTemplateColumns","gridTemplateRows","minWidth","boxShadow","shadow16","transform","transition","durationNormal","curveDecelerateMin","shadow8","clip","height","margin","overflow","padding","width","position","opacity","useStyles","gridRow","gridColumn","gridAutoRows","borderRadius","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground2","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","columnGap","spacingHorizontalMNudge","rowGap","spacingVerticalS","spacingVerticalL","spacingHorizontalL","border","strokeWidthThin","colorNeutralStroke2","style","outlineRadius","primaryActionHovered","alignItems","minHeight","spacingVerticalXXL","alignSelf","colorNeutralForeground1","body1Strong","overflowY","wordBreak","spacingVerticalNone","spacingHorizontalNone","durationFast","curveLinear","actionsWithCategory","promptNoReasonMarker","caption2","useSingleColumnStyles","flexDirection","spacingVerticalM","spacingHorizontalM","borderRadius2XL","caption1Strong","usePromptStarterStyles_unstable","state","isSingleColumn","styles","rootResetStyles","singleColumnStyles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,UAAU,EACVC,eAAe,EACfC,YAAY,EACZC,UAAU,EACVC,gBAAgB,EAChBC,uBAAuB,QAClB,6BAA6B;AACpC,SAASC,MAAM,QAAQ,2BAA2B;AAIlD,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,eAAe;IACfC,MAAM;IACNC,UAAU;IACVC,QAAQ;IACRC,cAAc;IACdC,SAAS;AACX,EAAE;AAEF,MAAMC,qBAAqBd,gBAAgB;IACzCe,SAAS;IACTC,qBAAqB;IACrBC,kBAAkB;IAClBC,UAAU;IAEV,8DAA8D;IAC9D,WAAW;QACT,CAAC,CAAC,GAAG,EAAEZ,wBAAwBE,aAAa,CAAC,CAAC,CAAC,EAAE;YAC/CW,WAAWd,OAAOe,QAAQ;YAC1BC,WAAW;YACXC,YAAY,CAAC,UAAU,EAAEjB,OAAOkB,cAAc,CAAC,CAAC,EAAElB,OAAOmB,kBAAkB,CAAC,CAAC;QAC/E;IACF;IACA,YAAY;QACV,CAAC,CAAC,GAAG,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,EAClDU,kBAAkBG,mBAAmB3E,MAAM,EAC3CuE,MAAMvE,MAAM,CAAC4E,SAAS;IAExB,IAAIL,MAAMtE,YAAY,EAAE;QACtBsE,MAAMtE,YAAY,CAAC2E,SAAS,GAAGtF,aAC7BK,wBAAwBM,YAAY,EACpCwE,OAAOxE,YAAY,EACnBsE,MAAMtE,YAAY,CAAC2E,SAAS;IAEhC;IACA,IAAIL,MAAMrE,OAAO,EAAE;QACjBqE,MAAMrE,OAAO,CAAC0E,SAAS,GAAGtF,aACxBK,wBAAwBO,OAAO,EAC/BuE,OAAOvE,OAAO,EACdqE,MAAMxE,QAAQ,IAAI0E,OAAOZ,mBAAmB,EAC5CU,MAAMrE,OAAO,CAAC0E,SAAS;IAE3B;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -81,18 +81,24 @@ const useStyles = makeStyles({
|
|
|
81
81
|
gridColumn: '1 / 2'
|
|
82
82
|
},
|
|
83
83
|
category: {
|
|
84
|
-
display: 'flex',
|
|
85
|
-
alignItems: 'center',
|
|
86
|
-
...typographyStyles.body1Strong,
|
|
87
84
|
gridRow: 1,
|
|
88
|
-
gridColumn: '2 / 3'
|
|
85
|
+
gridColumn: '2 / 3',
|
|
86
|
+
alignSelf: 'center',
|
|
87
|
+
color: tokens.colorNeutralForeground1,
|
|
88
|
+
...typographyStyles.body1Strong,
|
|
89
|
+
// Truncate text after one line.
|
|
90
|
+
display: '-webkit-box',
|
|
91
|
+
'-webkit-box-orient': 'vertical',
|
|
92
|
+
'-webkit-line-clamp': '1',
|
|
93
|
+
overflowY: 'hidden',
|
|
94
|
+
wordBreak: 'break-word'
|
|
89
95
|
},
|
|
90
96
|
actions: {
|
|
91
|
-
margin: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}
|
|
92
|
-
${tokens.spacingVerticalNone} ${tokens.spacingHorizontalNone}`,
|
|
93
|
-
position: 'relative',
|
|
94
97
|
gridRow: '1 / 2',
|
|
95
98
|
gridColumn: '2 / 3',
|
|
99
|
+
position: 'relative',
|
|
100
|
+
margin: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}
|
|
101
|
+
${tokens.spacingVerticalNone} ${tokens.spacingHorizontalNone}`,
|
|
96
102
|
opacity: 1,
|
|
97
103
|
transition: `opacity ${tokens.durationFast} ${tokens.curveLinear}`
|
|
98
104
|
},
|
|
@@ -102,14 +108,15 @@ const useStyles = makeStyles({
|
|
|
102
108
|
boxShadow: `-12px 0 12px 0 ${tokens.colorNeutralBackground1}`
|
|
103
109
|
},
|
|
104
110
|
prompt: {
|
|
111
|
+
gridRow: '2',
|
|
112
|
+
gridColumn: '1 / 3',
|
|
105
113
|
...typographyStyles.body1Strong,
|
|
106
114
|
// Truncate text after two lines.
|
|
107
115
|
display: '-webkit-box',
|
|
108
116
|
'-webkit-box-orient': 'vertical',
|
|
109
117
|
'-webkit-line-clamp': '2',
|
|
110
118
|
overflowY: 'hidden',
|
|
111
|
-
|
|
112
|
-
gridColumn: '1 / 3'
|
|
119
|
+
wordBreak: 'break-word'
|
|
113
120
|
},
|
|
114
121
|
promptNoReasonMarker: {
|
|
115
122
|
// Truncate text after three lines when no reason marker is present.
|
|
@@ -118,12 +125,20 @@ const useStyles = makeStyles({
|
|
|
118
125
|
reasonMarker: {
|
|
119
126
|
gridRow: '3',
|
|
120
127
|
gridColumn: '1 / 3',
|
|
121
|
-
...typographyStyles.caption2
|
|
128
|
+
...typographyStyles.caption2,
|
|
129
|
+
// Truncate text after one line.
|
|
130
|
+
display: '-webkit-box',
|
|
131
|
+
'-webkit-box-orient': 'vertical',
|
|
132
|
+
'-webkit-line-clamp': '1',
|
|
133
|
+
overflowY: 'hidden',
|
|
134
|
+
wordBreak: 'break-word'
|
|
122
135
|
}
|
|
123
136
|
});
|
|
124
137
|
const useSingleColumnStyles = makeStyles({
|
|
125
138
|
primaryAction: {
|
|
126
139
|
display: 'flex',
|
|
140
|
+
flexDirection: 'column',
|
|
141
|
+
padding: `${tokens.spacingVerticalM} ${tokens.spacingHorizontalM}`,
|
|
127
142
|
borderRadius: tokens.borderRadius2XL,
|
|
128
143
|
...createFocusOutlineStyle({
|
|
129
144
|
style: {
|
|
@@ -131,8 +146,14 @@ const useSingleColumnStyles = makeStyles({
|
|
|
131
146
|
}
|
|
132
147
|
})
|
|
133
148
|
},
|
|
149
|
+
category: {
|
|
150
|
+
...typographyStyles.caption1Strong,
|
|
151
|
+
alignSelf: 'auto'
|
|
152
|
+
},
|
|
134
153
|
prompt: {
|
|
135
|
-
...typographyStyles.caption1Strong
|
|
154
|
+
...typographyStyles.caption1Strong,
|
|
155
|
+
// Always truncate after two lines in single column layout.
|
|
156
|
+
'-webkit-line-clamp': '2'
|
|
136
157
|
}
|
|
137
158
|
});
|
|
138
159
|
export const usePromptStarterStyles_unstable = (state)=>{
|
|
@@ -147,7 +168,7 @@ export const usePromptStarterStyles_unstable = (state)=>{
|
|
|
147
168
|
state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, state.icon.className);
|
|
148
169
|
}
|
|
149
170
|
if (state.category) {
|
|
150
|
-
state.category.className = mergeClasses(promptStarterClassNames.category, styles.category, state.category.className);
|
|
171
|
+
state.category.className = mergeClasses(promptStarterClassNames.category, styles.category, isSingleColumn && singleColumnStyles.category, state.category.className);
|
|
151
172
|
}
|
|
152
173
|
state.prompt.className = mergeClasses(promptStarterClassNames.prompt, styles.prompt, !state.reasonMarker && styles.promptNoReasonMarker, isSingleColumn && singleColumnStyles.prompt, state.prompt.className);
|
|
153
174
|
if (state.reasonMarker) {
|
package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptStarterStyles.styles.ts"],"sourcesContent":["import {\n makeStyles,\n makeResetStyles,\n mergeClasses,\n shorthands,\n typographyStyles,\n createFocusOutlineStyle,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { PromptStarterSlots, PromptStarterState } from './PromptStarter.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptStarterClassNames: SlotClassNames<PromptStarterSlots> = {\n root: 'fai-PromptStarter',\n primaryAction: 'fai-PromptStarter__primaryAction',\n icon: 'fai-PromptStarter__icon',\n category: 'fai-PromptStarter__category',\n prompt: 'fai-PromptStarter__prompt',\n reasonMarker: 'fai-PromptStarter__reasonMarker',\n actions: 'fai-PromptStarter__actions',\n};\n\nconst useRootResetStyles = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: '1fr auto',\n gridTemplateRows: 'max-content auto',\n minWidth: '214px',\n\n // Apply styles to the primary action on hover / active states\n '&:hover': {\n [`& .${promptStarterClassNames.primaryAction}`]: {\n boxShadow: tokens.shadow16,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n },\n '&:active': {\n [`& .${promptStarterClassNames.primaryAction}`]: {\n boxShadow: tokens.shadow8,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n },\n\n // Hide actions when not focused or hovered\n ':not(:focus-within):not(:hover)': {\n [`& .${promptStarterClassNames.actions}`]: {\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute',\n opacity: 0,\n },\n },\n});\n\nconst useStyles = makeStyles({\n primaryAction: {\n gridRow: '1 / 3',\n gridColumn: '1 / 3',\n position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'max-content 1fr',\n gridAutoRows: 'max-content 1fr max-content',\n borderRadius: '28px',\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground2,\n fontFamily: tokens.fontFamilyBase,\n cursor: 'pointer',\n outlineStyle: 'none',\n textAlign: 'left',\n columnGap: tokens.spacingHorizontalMNudge,\n rowGap: tokens.spacingVerticalS,\n padding: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}`,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n ...createFocusOutlineStyle({ style: { outlineRadius: '28px' } }),\n },\n\n primaryActionHovered: {\n boxShadow: tokens.shadow16,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n\n icon: {\n display: 'flex',\n alignItems: 'center',\n minHeight: tokens.spacingVerticalXXL,\n gridRow: 1,\n gridColumn: '1 / 2',\n },\n category: {\n display: 'flex',\n alignItems: 'center',\n ...typographyStyles.body1Strong,\n\n gridRow: 1,\n gridColumn: '2 / 3',\n },\n actions: {\n margin: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}\n ${tokens.spacingVerticalNone} ${tokens.spacingHorizontalNone}`,\n position: 'relative',\n gridRow: '1 / 2',\n gridColumn: '2 / 3',\n\n opacity: 1,\n transition: `opacity ${tokens.durationFast} ${tokens.curveLinear}`,\n },\n actionsWithCategory: {\n // Add a background and gradient fade to truncate the title if applicable\n backgroundColor: tokens.colorNeutralBackground1,\n\n boxShadow: `-12px 0 12px 0 ${tokens.colorNeutralBackground1}`,\n },\n prompt: {\n ...typographyStyles.body1Strong,\n\n // Truncate text after two lines.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '2',\n overflowY: 'hidden',\n gridRow: '2',\n gridColumn: '1 / 3',\n },\n promptNoReasonMarker: {\n // Truncate text after three lines when no reason marker is present.\n '-webkit-line-clamp': '3',\n },\n reasonMarker: {\n gridRow: '3',\n gridColumn: '1 / 3',\n ...typographyStyles.caption2,\n },\n});\n\nconst useSingleColumnStyles = makeStyles({\n primaryAction: {\n display: 'flex',\n borderRadius: tokens.borderRadius2XL,\n ...createFocusOutlineStyle({ style: { outlineRadius: tokens.borderRadius2XL } }),\n },\n prompt: {\n ...typographyStyles.caption1Strong,\n },\n});\n\nexport const usePromptStarterStyles_unstable = (state: PromptStarterState): PromptStarterState => {\n 'use no memo';\n\n const { isSingleColumn } = state;\n\n const styles = useStyles();\n const rootResetStyles = useRootResetStyles();\n const singleColumnStyles = useSingleColumnStyles();\n state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, state.root.className);\n state.primaryAction.className = mergeClasses(\n promptStarterClassNames.primaryAction,\n styles.primaryAction,\n isSingleColumn && singleColumnStyles.primaryAction,\n state.primaryAction.className,\n );\n if (state.icon) {\n state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, state.icon.className);\n }\n if (state.category) {\n state.category.className = mergeClasses(\n promptStarterClassNames.category,\n styles.category,\n state.category.className,\n );\n }\n state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\n !state.reasonMarker && styles.promptNoReasonMarker,\n isSingleColumn && singleColumnStyles.prompt,\n state.prompt.className,\n );\n if (state.reasonMarker) {\n state.reasonMarker.className = mergeClasses(\n promptStarterClassNames.reasonMarker,\n styles.reasonMarker,\n state.reasonMarker.className,\n );\n }\n if (state.actions) {\n state.actions.className = mergeClasses(\n promptStarterClassNames.actions,\n styles.actions,\n state.category && styles.actionsWithCategory,\n state.actions.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","shorthands","typographyStyles","createFocusOutlineStyle","tokens","promptStarterClassNames","root","primaryAction","icon","category","prompt","reasonMarker","actions","useRootResetStyles","display","gridTemplateColumns","gridTemplateRows","minWidth","boxShadow","shadow16","transform","transition","durationNormal","curveDecelerateMin","shadow8","clip","height","margin","overflow","padding","width","position","opacity","useStyles","gridRow","gridColumn","gridAutoRows","borderRadius","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground2","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","columnGap","spacingHorizontalMNudge","rowGap","spacingVerticalS","spacingVerticalL","spacingHorizontalL","border","strokeWidthThin","colorNeutralStroke2","style","outlineRadius","primaryActionHovered","alignItems","minHeight","spacingVerticalXXL","body1Strong","spacingVerticalNone","spacingHorizontalNone","durationFast","curveLinear","actionsWithCategory","overflowY","promptNoReasonMarker","caption2","useSingleColumnStyles","borderRadius2XL","caption1Strong","usePromptStarterStyles_unstable","state","isSingleColumn","styles","rootResetStyles","singleColumnStyles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,UAAU,EACVC,eAAe,EACfC,YAAY,EACZC,UAAU,EACVC,gBAAgB,EAChBC,uBAAuB,QAClB,6BAA6B;AACpC,SAASC,MAAM,QAAQ,2BAA2B;AAIlD,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,eAAe;IACfC,MAAM;IACNC,UAAU;IACVC,QAAQ;IACRC,cAAc;IACdC,SAAS;AACX,EAAE;AAEF,MAAMC,qBAAqBd,gBAAgB;IACzCe,SAAS;IACTC,qBAAqB;IACrBC,kBAAkB;IAClBC,UAAU;IAEV,8DAA8D;IAC9D,WAAW;QACT,CAAC,CAAC,GAAG,EAAEZ,wBAAwBE,aAAa,CAAC,CAAC,CAAC,EAAE;YAC/CW,WAAWd,OAAOe,QAAQ;YAC1BC,WAAW;YACXC,YAAY,CAAC,UAAU,EAAEjB,OAAOkB,cAAc,CAAC,CAAC,EAAElB,OAAOmB,kBAAkB,CAAC,CAAC;QAC/E;IACF;IACA,YAAY;QACV,CAAC,CAAC,GAAG,EAAElB,wBAAwBE,aAAa,CAAC,CAAC,CAAC,EAAE;YAC/CW,WAAWd,OAAOoB,OAAO;YACzBJ,WAAW;YACXC,YAAY,CAAC,UAAU,EAAEjB,OAAOkB,cAAc,CAAC,CAAC,EAAElB,OAAOmB,kBAAkB,CAAC,CAAC;QAC/E;IACF;IAEA,2CAA2C;IAC3C,mCAAmC;QACjC,CAAC,CAAC,GAAG,EAAElB,wBAAwBO,OAAO,C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a,EAClDoE,MAAMpE,aAAa,CAACyE,SAAS;IAE/B,IAAIL,MAAMnE,IAAI,EAAE;QACdmE,MAAMnE,IAAI,CAACwE,SAAS,GAAGhF,aAAaK,wBAAwBG,IAAI,EAAEqE,OAAOrE,IAAI,EAAEmE,MAAMnE,IAAI,CAACwE,SAAS;IACrG;IACA,IAAIL,MAAMlE,QAAQ,EAAE;QAClBkE,MAAMlE,QAAQ,CAACuE,SAAS,GAAGhF,aACzBK,wBAAwBI,QAAQ,EAChCoE,OAAOpE,QAAQ,EACfkE,MAAMlE,QAAQ,CAACuE,SAAS;IAE5B;IACAL,MAAMjE,MAAM,CAACsE,SAAS,GAAGhF,aACvBK,wBAAwBK,MAAM,EAC9BmE,OAAOnE,MAAM,EACb,CAACiE,MAAMhE,YAAY,IAAIkE,OAAOR,oBAAoB,EAClDO,kBAAkBG,mBAAmBrE,MAAM,EAC3CiE,MAAMjE,MAAM,CAACsE,SAAS;IAExB,IAAIL,MAAMhE,YAAY,EAAE;QACtBgE,MAAMhE,YAAY,CAACqE,SAAS,GAAGhF,aAC7BK,wBAAwBM,YAAY,EACpCkE,OAAOlE,YAAY,EACnBgE,MAAMhE,YAAY,CAACqE,SAAS;IAEhC;IACA,IAAIL,MAAM/D,OAAO,EAAE;QACjB+D,MAAM/D,OAAO,CAACoE,SAAS,GAAGhF,aACxBK,wBAAwBO,OAAO,EAC/BiE,OAAOjE,OAAO,EACd+D,MAAMlE,QAAQ,IAAIoE,OAAOV,mBAAmB,EAC5CQ,MAAM/D,OAAO,CAACoE,SAAS;IAE3B;IAEA,OAAOL;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["usePromptStarterStyles.styles.ts"],"sourcesContent":["import {\n makeStyles,\n makeResetStyles,\n mergeClasses,\n shorthands,\n typographyStyles,\n createFocusOutlineStyle,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { PromptStarterSlots, PromptStarterState } from './PromptStarter.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptStarterClassNames: SlotClassNames<PromptStarterSlots> = {\n root: 'fai-PromptStarter',\n primaryAction: 'fai-PromptStarter__primaryAction',\n icon: 'fai-PromptStarter__icon',\n category: 'fai-PromptStarter__category',\n prompt: 'fai-PromptStarter__prompt',\n reasonMarker: 'fai-PromptStarter__reasonMarker',\n actions: 'fai-PromptStarter__actions',\n};\n\nconst useRootResetStyles = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: '1fr auto',\n gridTemplateRows: 'max-content auto',\n minWidth: '214px',\n\n // Apply styles to the primary action on hover / active states\n '&:hover': {\n [`& .${promptStarterClassNames.primaryAction}`]: {\n boxShadow: tokens.shadow16,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n },\n '&:active': {\n [`& .${promptStarterClassNames.primaryAction}`]: {\n boxShadow: tokens.shadow8,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n },\n\n // Hide actions when not focused or hovered\n ':not(:focus-within):not(:hover)': {\n [`& .${promptStarterClassNames.actions}`]: {\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute',\n opacity: 0,\n },\n },\n});\n\nconst useStyles = makeStyles({\n primaryAction: {\n gridRow: '1 / 3',\n gridColumn: '1 / 3',\n position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'max-content 1fr',\n gridAutoRows: 'max-content 1fr max-content',\n borderRadius: '28px',\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground2,\n fontFamily: tokens.fontFamilyBase,\n cursor: 'pointer',\n outlineStyle: 'none',\n textAlign: 'left',\n columnGap: tokens.spacingHorizontalMNudge,\n rowGap: tokens.spacingVerticalS,\n padding: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}`,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n ...createFocusOutlineStyle({ style: { outlineRadius: '28px' } }),\n },\n\n primaryActionHovered: {\n boxShadow: tokens.shadow16,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n\n icon: {\n display: 'flex',\n alignItems: 'center',\n minHeight: tokens.spacingVerticalXXL,\n gridRow: 1,\n gridColumn: '1 / 2',\n },\n category: {\n gridRow: 1,\n gridColumn: '2 / 3',\n alignSelf: 'center',\n\n color: tokens.colorNeutralForeground1,\n ...typographyStyles.body1Strong,\n\n // Truncate text after one line.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '1',\n overflowY: 'hidden',\n wordBreak: 'break-word',\n },\n actions: {\n gridRow: '1 / 2',\n gridColumn: '2 / 3',\n position: 'relative',\n margin: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}\n ${tokens.spacingVerticalNone} ${tokens.spacingHorizontalNone}`,\n opacity: 1,\n transition: `opacity ${tokens.durationFast} ${tokens.curveLinear}`,\n },\n actionsWithCategory: {\n // Add a background and gradient fade to truncate the title if applicable\n backgroundColor: tokens.colorNeutralBackground1,\n\n boxShadow: `-12px 0 12px 0 ${tokens.colorNeutralBackground1}`,\n },\n prompt: {\n gridRow: '2',\n gridColumn: '1 / 3',\n\n ...typographyStyles.body1Strong,\n\n // Truncate text after two lines.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '2',\n overflowY: 'hidden',\n wordBreak: 'break-word',\n },\n promptNoReasonMarker: {\n // Truncate text after three lines when no reason marker is present.\n '-webkit-line-clamp': '3',\n },\n reasonMarker: {\n gridRow: '3',\n gridColumn: '1 / 3',\n\n ...typographyStyles.caption2,\n\n // Truncate text after one line.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '1',\n overflowY: 'hidden',\n wordBreak: 'break-word',\n },\n});\n\nconst useSingleColumnStyles = makeStyles({\n primaryAction: {\n display: 'flex',\n flexDirection: 'column',\n padding: `${tokens.spacingVerticalM} ${tokens.spacingHorizontalM}`,\n borderRadius: tokens.borderRadius2XL,\n ...createFocusOutlineStyle({ style: { outlineRadius: tokens.borderRadius2XL } }),\n },\n category: {\n ...typographyStyles.caption1Strong,\n alignSelf: 'auto',\n },\n prompt: {\n ...typographyStyles.caption1Strong,\n\n // Always truncate after two lines in single column layout.\n '-webkit-line-clamp': '2',\n },\n});\n\nexport const usePromptStarterStyles_unstable = (state: PromptStarterState): PromptStarterState => {\n 'use no memo';\n\n const { isSingleColumn } = state;\n\n const styles = useStyles();\n const rootResetStyles = useRootResetStyles();\n const singleColumnStyles = useSingleColumnStyles();\n state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, state.root.className);\n state.primaryAction.className = mergeClasses(\n promptStarterClassNames.primaryAction,\n styles.primaryAction,\n isSingleColumn && singleColumnStyles.primaryAction,\n state.primaryAction.className,\n );\n if (state.icon) {\n state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, state.icon.className);\n }\n if (state.category) {\n state.category.className = mergeClasses(\n promptStarterClassNames.category,\n styles.category,\n isSingleColumn && singleColumnStyles.category,\n state.category.className,\n );\n }\n state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\n !state.reasonMarker && styles.promptNoReasonMarker,\n isSingleColumn && singleColumnStyles.prompt,\n state.prompt.className,\n );\n if (state.reasonMarker) {\n state.reasonMarker.className = mergeClasses(\n promptStarterClassNames.reasonMarker,\n styles.reasonMarker,\n state.reasonMarker.className,\n );\n }\n if (state.actions) {\n state.actions.className = mergeClasses(\n promptStarterClassNames.actions,\n styles.actions,\n state.category && styles.actionsWithCategory,\n state.actions.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","shorthands","typographyStyles","createFocusOutlineStyle","tokens","promptStarterClassNames","root","primaryAction","icon","category","prompt","reasonMarker","actions","useRootResetStyles","display","gridTemplateColumns","gridTemplateRows","minWidth","boxShadow","shadow16","transform","transition","durationNormal","curveDecelerateMin","shadow8","clip","height","margin","overflow","padding","width","position","opacity","useStyles","gridRow","gridColumn","gridAutoRows","borderRadius","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground2","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","columnGap","spacingHorizontalMNudge","rowGap","spacingVerticalS","spacingVerticalL","spacingHorizontalL","border","strokeWidthThin","colorNeutralStroke2","style","outlineRadius","primaryActionHovered","alignItems","minHeight","spacingVerticalXXL","alignSelf","colorNeutralForeground1","body1Strong","overflowY","wordBreak","spacingVerticalNone","spacingHorizontalNone","durationFast","curveLinear","actionsWithCategory","promptNoReasonMarker","caption2","useSingleColumnStyles","flexDirection","spacingVerticalM","spacingHorizontalM","borderRadius2XL","caption1Strong","usePromptStarterStyles_unstable","state","isSingleColumn","styles","rootResetStyles","singleColumnStyles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,UAAU,EACVC,eAAe,EACfC,YAAY,EACZC,UAAU,EACVC,gBAAgB,EAChBC,uBAAuB,QAClB,6BAA6B;AACpC,SAASC,MAAM,QAAQ,2BAA2B;AAIlD,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,eAAe;IACfC,MAAM;IACNC,UAAU;IACVC,QAAQ;IACRC,cAAc;IACdC,SAAS;AACX,EAAE;AAEF,MAAMC,qBAAqBd,gBAAgB;IACzCe,SAAS;IACTC,qBAAqB;IACrBC,kBAAkB;IAClBC,UAAU;IAEV,8DAA8D;IAC9D,WAAW;QACT,CAAC,CAAC,GAAG,EAAEZ,wBAAwBE,aAAa,CAAC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mBAAmB5E,QAAQ,EAC7CwE,MAAMxE,QAAQ,CAAC6E,SAAS;IAE5B;IACAL,MAAMvE,MAAM,CAAC4E,SAAS,GAAGtF,aACvBK,wBAAwBK,MAAM,EAC9ByE,OAAOzE,MAAM,EACb,CAACuE,MAAMtE,YAAY,IAAIwE,OAAOX,oBAAoB,EAClDU,kBAAkBG,mBAAmB3E,MAAM,EAC3CuE,MAAMvE,MAAM,CAAC4E,SAAS;IAExB,IAAIL,MAAMtE,YAAY,EAAE;QACtBsE,MAAMtE,YAAY,CAAC2E,SAAS,GAAGtF,aAC7BK,wBAAwBM,YAAY,EACpCwE,OAAOxE,YAAY,EACnBsE,MAAMtE,YAAY,CAAC2E,SAAS;IAEhC;IACA,IAAIL,MAAMrE,OAAO,EAAE;QACjBqE,MAAMrE,OAAO,CAAC0E,SAAS,GAAGtF,aACxBK,wBAAwBO,OAAO,EAC/BuE,OAAOvE,OAAO,EACdqE,MAAMxE,QAAQ,IAAI0E,OAAOZ,mBAAmB,EAC5CU,MAAMrE,OAAO,CAAC0E,SAAS;IAE3B;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptStarterList.types.ts"],"sourcesContent":["import type { DesignVersion } from '@fluentui-copilot/react-provider';\nimport type {\n ComponentProps,\n ComponentState,\n Slot,\n Button,\n UseArrowNavigationGroupOptions,\n} from '@fluentui/react-components';\n\nexport type PromptStarterListSlots = {\n root: NonNullable<Slot<'div'>>;\n gridWrapper: NonNullable<Slot<'div'>>;\n actions?: Slot<'span'>;\n expandButton?: Slot<typeof Button>;\n};\n\n/**\n * PromptStarterList Props\n */\nexport type PromptStarterListProps = ComponentProps<Partial<PromptStarterListSlots>, 'gridWrapper'> &\n DesignVersion & {\n /**\n * Text for the expand button when the list is collapsed.\n *\n * default: \"Show more\"\n */\n expandButtonLabel?: string;\n /**\n * Text for the expand button when the list is expanded.\n *\n * default: \"Show less\"\n */\n collapseButtonLabel?: string;\n /**\n * Arrow navigation options. This can be used to customize Tabster's direction,\n * tab behavior, and memoization options.\n *\n * default: { axis: 'horizontal', memorizeCurrent: true }\n */\n arrowNavigationOptions?: UseArrowNavigationGroupOptions;\n\n /**\n * Whether to animate the entrance of its items when it first mounts.\n *\n * @default true\n */\n animateOnMount?: boolean;\n };\n\n/**\n * State used in rendering PromptStarterList\n */\nexport type PromptStarterListState = ComponentState<PromptStarterListSlots> &\n Required<Pick<PromptStarterListProps, 'designVersion'>> & {\n numberOfColumns: number;\n isExpanded?: boolean;\n };\n\nexport type PromptStarterListContextValue = Pick<PromptStarterListState, 'numberOfColumns' | 'isExpanded'>;\n"],"names":[],"rangeMappings":"","mappings":"
|
|
1
|
+
{"version":3,"sources":["PromptStarterList.types.ts"],"sourcesContent":["import type { DesignVersion } from '@fluentui-copilot/react-provider';\nimport type {\n ComponentProps,\n ComponentState,\n Slot,\n Button,\n UseArrowNavigationGroupOptions,\n} from '@fluentui/react-components';\n\nexport type PromptStarterListSlots = {\n root: NonNullable<Slot<'div'>>;\n gridWrapper: NonNullable<Slot<'div'>>;\n actions?: Slot<'span'>;\n expandButton?: Slot<typeof Button>;\n};\n\n/**\n * PromptStarterList Props\n */\nexport type PromptStarterListProps = ComponentProps<Partial<PromptStarterListSlots>, 'gridWrapper'> &\n DesignVersion & {\n /**\n * Uncontrolled initial value for the expanded prop.\n *\n * @default false\n */\n defaultExpanded?: boolean;\n\n /**\n * Controls whether the PromptStarterList is expanded.\n */\n isExpanded?: boolean;\n\n /**\n * Callback to execute when the expanded state changes.\n */\n onExpandedChange?: (event: React.MouseEvent<HTMLElement>, data: { isExpanded: boolean }) => void;\n\n /**\n * Text for the expand button when the list is collapsed.\n *\n * default: \"Show more\"\n */\n expandButtonLabel?: string;\n\n /**\n * Text for the expand button when the list is expanded.\n *\n * default: \"Show less\"\n */\n collapseButtonLabel?: string;\n\n /**\n * Arrow navigation options. This can be used to customize Tabster's direction,\n * tab behavior, and memoization options.\n *\n * default: { axis: 'horizontal', memorizeCurrent: true }\n */\n arrowNavigationOptions?: UseArrowNavigationGroupOptions;\n\n /**\n * Whether to animate the entrance of its items when it first mounts.\n *\n * @default true\n */\n animateOnMount?: boolean;\n\n /**\n * The number of rows that are visible in the two and three column layouts.\n * In the one column layout, there will always be three visible PromptStarters.\n *\n * @default 1\n */\n visibleRows?: number;\n };\n\n/**\n * State used in rendering PromptStarterList\n */\nexport type PromptStarterListState = ComponentState<PromptStarterListSlots> &\n Required<Pick<PromptStarterListProps, 'designVersion'>> & {\n numberOfColumns: number;\n isExpanded?: boolean;\n };\n\nexport type PromptStarterListContextValue = Pick<PromptStarterListState, 'numberOfColumns' | 'isExpanded'>;\n"],"names":[],"rangeMappings":"","mappings":"AAqFA,WAA2G"}
|
|
@@ -3,6 +3,7 @@ import { getIntrinsicElementProps, slot, Button, useArrowNavigationGroup, mergeC
|
|
|
3
3
|
import { useDesignVersion } from '@fluentui-copilot/react-provider';
|
|
4
4
|
import { ChevronDown12Regular } from '@fluentui/react-icons';
|
|
5
5
|
import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
|
|
6
|
+
import { useControllableState } from '@fluentui/react-utilities';
|
|
6
7
|
/**
|
|
7
8
|
* Create the state required to render PromptStarterList.
|
|
8
9
|
*
|
|
@@ -12,7 +13,7 @@ import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
|
|
|
12
13
|
* @param props - props from this instance of PromptStarterList
|
|
13
14
|
* @param ref - reference to root HTMLElement of PromptStarterList
|
|
14
15
|
*/ export const usePromptStarterList_unstable = (props, ref)=>{
|
|
15
|
-
const { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less', animateOnMount = true } = props;
|
|
16
|
+
const { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less', onExpandedChange, animateOnMount = true, visibleRows = 1 } = props;
|
|
16
17
|
const designVersion = useDesignVersion(props.designVersion);
|
|
17
18
|
var _arrowNavigationOptions_axis, _arrowNavigationOptions_memorizeCurrent;
|
|
18
19
|
const focusAttrs = useArrowNavigationGroup({
|
|
@@ -20,7 +21,22 @@ import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
|
|
|
20
21
|
axis: (_arrowNavigationOptions_axis = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.axis) !== null && _arrowNavigationOptions_axis !== void 0 ? _arrowNavigationOptions_axis : 'both',
|
|
21
22
|
memorizeCurrent: (_arrowNavigationOptions_memorizeCurrent = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.memorizeCurrent) !== null && _arrowNavigationOptions_memorizeCurrent !== void 0 ? _arrowNavigationOptions_memorizeCurrent : true
|
|
22
23
|
});
|
|
23
|
-
const [isExpanded, setIsExpanded] =
|
|
24
|
+
const [isExpanded, setIsExpanded] = useControllableState({
|
|
25
|
+
state: props.isExpanded,
|
|
26
|
+
defaultState: props.defaultExpanded,
|
|
27
|
+
initialState: false
|
|
28
|
+
});
|
|
29
|
+
const toggleExpanded = React.useCallback((event)=>{
|
|
30
|
+
setIsExpanded((prevExpanded)=>{
|
|
31
|
+
onExpandedChange === null || onExpandedChange === void 0 ? void 0 : onExpandedChange(event, {
|
|
32
|
+
isExpanded: !prevExpanded
|
|
33
|
+
});
|
|
34
|
+
return !prevExpanded;
|
|
35
|
+
});
|
|
36
|
+
}, [
|
|
37
|
+
setIsExpanded,
|
|
38
|
+
onExpandedChange
|
|
39
|
+
]);
|
|
24
40
|
const [numberOfColumns, setNumberOfColumns] = React.useState(3);
|
|
25
41
|
const gridWrapperRef = React.useRef(null);
|
|
26
42
|
const { targetDocument } = useFluent();
|
|
@@ -42,7 +58,7 @@ import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
|
|
|
42
58
|
]);
|
|
43
59
|
const state = {
|
|
44
60
|
numberOfColumns: numberOfColumns,
|
|
45
|
-
isExpanded,
|
|
61
|
+
isExpanded: isExpanded,
|
|
46
62
|
designVersion,
|
|
47
63
|
components: {
|
|
48
64
|
root: 'div',
|
|
@@ -93,10 +109,9 @@ import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
|
|
|
93
109
|
if (!/*#__PURE__*/ React.isValidElement(child) || child.type === React.Fragment) {
|
|
94
110
|
throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');
|
|
95
111
|
}
|
|
96
|
-
// In the collapsed state, if there is one column, we show three children.
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
const visibility = numberOfColumns === 1 && index < 3 || index < numberOfColumns || isExpanded;
|
|
112
|
+
// In the collapsed state, if there is one column, we show three children. If there are two or three columns,
|
|
113
|
+
// we show two or three (or four or six, if there are two visible rows). All children are shown in the isExpanded state.
|
|
114
|
+
const visibility = numberOfColumns === 1 && index < 3 || index < numberOfColumns * visibleRows || isExpanded;
|
|
100
115
|
return /*#__PURE__*/ React.createElement(PromptStarterMotion, {
|
|
101
116
|
appear: animateOnMount,
|
|
102
117
|
key: index,
|
|
@@ -110,8 +125,12 @@ import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
|
|
|
110
125
|
isExpanded
|
|
111
126
|
]);
|
|
112
127
|
state.root.children = childrenWithMotion;
|
|
128
|
+
const numChildren = childrenArray.length;
|
|
129
|
+
if (numberOfColumns === 1 && numChildren <= 3 || numChildren <= numberOfColumns * visibleRows) {
|
|
130
|
+
state.expandButton = undefined;
|
|
131
|
+
}
|
|
113
132
|
if (state.expandButton) {
|
|
114
|
-
state.expandButton.onClick = mergeCallbacks(state.expandButton.onClick,
|
|
133
|
+
state.expandButton.onClick = mergeCallbacks(state.expandButton.onClick, toggleExpanded);
|
|
115
134
|
}
|
|
116
135
|
return state;
|
|
117
136
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptStarterList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n slot,\n Button,\n useArrowNavigationGroup,\n mergeCallbacks,\n useFluent,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport type { PromptStarterListProps, PromptStarterListState } from './PromptStarterList.types';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport { ChevronDown12Regular } from '@fluentui/react-icons';\nimport { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';\n\n/**\n * Create the state required to render PromptStarterList.\n *\n * The returned state can be modified with hooks such as usePromptStarterListStyles_unstable,\n * before being passed to renderPromptStarterList_unstable.\n *\n * @param props - props from this instance of PromptStarterList\n * @param ref - reference to root HTMLElement of PromptStarterList\n */\nexport const usePromptStarterList_unstable = (\n props: PromptStarterListProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptStarterListState => {\n const {\n arrowNavigationOptions,\n expandButtonLabel = 'Show more',\n collapseButtonLabel = 'Show less',\n animateOnMount = true,\n } = props;\n const designVersion = useDesignVersion(props.designVersion);\n const focusAttrs = useArrowNavigationGroup({\n ...arrowNavigationOptions,\n axis: arrowNavigationOptions?.axis ?? 'both',\n memorizeCurrent: arrowNavigationOptions?.memorizeCurrent ?? true,\n });\n\n const [isExpanded, setIsExpanded] = React.useState(false);\n const [numberOfColumns, setNumberOfColumns] = React.useState<number>(3);\n\n const gridWrapperRef = React.useRef<HTMLDivElement>(null);\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n\n React.useEffect(() => {\n if (!win || !gridWrapperRef.current) return;\n\n const promptStarterGrid = gridWrapperRef.current;\n\n const updateNumberOfColumns = () => {\n const numColumns = win.getComputedStyle(promptStarterGrid).gridTemplateColumns.split(' ').length;\n setNumberOfColumns(numColumns);\n };\n\n const ro = new win.ResizeObserver(updateNumberOfColumns);\n ro.observe(promptStarterGrid);\n\n return () => {\n ro.unobserve(promptStarterGrid);\n };\n }, [win]);\n\n const state: PromptStarterListState = {\n numberOfColumns: numberOfColumns,\n isExpanded,\n designVersion,\n components: {\n root: 'div',\n gridWrapper: 'div',\n actions: 'span',\n expandButton: Button,\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n gridWrapper: slot.always(props.gridWrapper, {\n defaultProps: {\n role: 'list',\n ...focusAttrs,\n },\n elementType: 'div',\n }),\n actions: slot.optional(props.actions, {\n elementType: 'span',\n }),\n expandButton: slot.optional(props.expandButton, {\n defaultProps: {\n appearance: 'subtle',\n size: 'small',\n shape: 'rounded',\n icon: <ChevronDown12Regular />,\n iconPosition: 'after',\n 'aria-expanded': isExpanded,\n children: isExpanded ? collapseButtonLabel : expandButtonLabel,\n },\n renderByDefault: true,\n elementType: Button,\n }),\n };\n\n state.gridWrapper.ref = useMergedRefs(gridWrapperRef, state.gridWrapper.ref);\n\n // Get the array of children.\n const childrenArray = React.useMemo<\n (React.ReactElement<any> | number | string | Iterable<React.ReactNode> | React.ReactPortal)[]\n >(() => {\n return React.Children.toArray(state.root.children);\n }, [state.root.children]);\n\n // Add motion to the children.\n const childrenWithMotion = React.useMemo(\n () =>\n childrenArray.map((child, index) => {\n // Throw error if the child is not a valid React element or is a Fragment.\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');\n }\n\n // In the collapsed state, if there is one column, we show three children.\n // If there are two or three columns, we show two or three. All children\n // are shown in the expanded state.\n const visibility = (numberOfColumns === 1 && index < 3) || index < numberOfColumns || isExpanded;\n\n return (\n <PromptStarterMotion\n appear={animateOnMount}\n key={index}\n index={index}\n visible={visibility}\n numberOfColumns={numberOfColumns}\n >\n {child}\n </PromptStarterMotion>\n );\n }),\n [childrenArray, numberOfColumns, isExpanded],\n );\n\n state.root.children = childrenWithMotion;\n\n if (state.expandButton) {\n state.expandButton.onClick = mergeCallbacks(\n state.expandButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n () => setIsExpanded(!isExpanded),\n );\n }\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","Button","useArrowNavigationGroup","mergeCallbacks","useFluent","useMergedRefs","useDesignVersion","ChevronDown12Regular","PromptStarterMotion","usePromptStarterList_unstable","props","ref","arrowNavigationOptions","expandButtonLabel","collapseButtonLabel","animateOnMount","designVersion","focusAttrs","axis","memorizeCurrent","isExpanded","setIsExpanded","useState","numberOfColumns","setNumberOfColumns","gridWrapperRef","useRef","targetDocument","win","defaultView","useEffect","current","promptStarterGrid","updateNumberOfColumns","numColumns","getComputedStyle","gridTemplateColumns","split","length","ro","ResizeObserver","observe","unobserve","state","components","root","gridWrapper","actions","expandButton","always","elementType","defaultProps","role","optional","appearance","size","shape","icon","iconPosition","children","renderByDefault","childrenArray","useMemo","Children","toArray","childrenWithMotion","map","child","index","isValidElement","type","Fragment","Error","visibility","appear","key","visible","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,wBAAwB,EACxBC,IAAI,EACJC,MAAM,EACNC,uBAAuB,EACvBC,cAAc,EACdC,SAAS,EACTC,aAAa,QACR,6BAA6B;AAEpC,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,mBAAmB,QAAQ,uCAAuC;AAE3E;;;;;;;;CAQC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEA,MAAM,EACJC,sBAAsB,EACtBC,oBAAoB,WAAW,EAC/BC,sBAAsB,WAAW,EACjCC,iBAAiB,IAAI,EACtB,GAAGL;IACJ,MAAMM,gBAAgBV,iBAAiBI,MAAMM,aAAa;QAGlDJ,8BACWA;IAHnB,MAAMK,aAAaf,wBAAwB;QACzC,GAAGU,sBAAsB;QACzBM,MAAMN,CAAAA,+BAAAA,mCAAAA,6CAAAA,uBAAwBM,IAAI,cAA5BN,0CAAAA,+BAAgC;QACtCO,iBAAiBP,CAAAA,0C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Content":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n slot,\n Button,\n useArrowNavigationGroup,\n mergeCallbacks,\n useFluent,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport type { PromptStarterListProps, PromptStarterListState } from './PromptStarterList.types';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport { ChevronDown12Regular } from '@fluentui/react-icons';\nimport { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';\nimport { useControllableState } from '@fluentui/react-utilities';\n\n/**\n * Create the state required to render PromptStarterList.\n *\n * The returned state can be modified with hooks such as usePromptStarterListStyles_unstable,\n * before being passed to renderPromptStarterList_unstable.\n *\n * @param props - props from this instance of PromptStarterList\n * @param ref - reference to root HTMLElement of PromptStarterList\n */\nexport const usePromptStarterList_unstable = (\n props: PromptStarterListProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptStarterListState => {\n const {\n arrowNavigationOptions,\n expandButtonLabel = 'Show more',\n collapseButtonLabel = 'Show less',\n onExpandedChange,\n animateOnMount = true,\n visibleRows = 1,\n } = props;\n const designVersion = useDesignVersion(props.designVersion);\n const focusAttrs = useArrowNavigationGroup({\n ...arrowNavigationOptions,\n axis: arrowNavigationOptions?.axis ?? 'both',\n memorizeCurrent: arrowNavigationOptions?.memorizeCurrent ?? true,\n });\n\n const [isExpanded, setIsExpanded] = useControllableState({\n state: props.isExpanded,\n defaultState: props.defaultExpanded,\n initialState: false,\n });\n const toggleExpanded = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n setIsExpanded(prevExpanded => {\n onExpandedChange?.(event, { isExpanded: !prevExpanded });\n return !prevExpanded;\n });\n },\n [setIsExpanded, onExpandedChange],\n );\n const [numberOfColumns, setNumberOfColumns] = React.useState<number>(3);\n\n const gridWrapperRef = React.useRef<HTMLDivElement>(null);\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n\n React.useEffect(() => {\n if (!win || !gridWrapperRef.current) return;\n\n const promptStarterGrid = gridWrapperRef.current;\n\n const updateNumberOfColumns = () => {\n const numColumns = win.getComputedStyle(promptStarterGrid).gridTemplateColumns.split(' ').length;\n setNumberOfColumns(numColumns);\n };\n\n const ro = new win.ResizeObserver(updateNumberOfColumns);\n ro.observe(promptStarterGrid);\n\n return () => {\n ro.unobserve(promptStarterGrid);\n };\n }, [win]);\n\n const state: PromptStarterListState = {\n numberOfColumns: numberOfColumns,\n isExpanded: isExpanded,\n designVersion,\n components: {\n root: 'div',\n gridWrapper: 'div',\n actions: 'span',\n expandButton: Button,\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n gridWrapper: slot.always(props.gridWrapper, {\n defaultProps: {\n role: 'list',\n ...focusAttrs,\n },\n elementType: 'div',\n }),\n actions: slot.optional(props.actions, {\n elementType: 'span',\n }),\n expandButton: slot.optional(props.expandButton, {\n defaultProps: {\n appearance: 'subtle',\n size: 'small',\n shape: 'rounded',\n icon: <ChevronDown12Regular />,\n iconPosition: 'after',\n 'aria-expanded': isExpanded,\n children: isExpanded ? collapseButtonLabel : expandButtonLabel,\n },\n renderByDefault: true,\n elementType: Button,\n }),\n };\n\n state.gridWrapper.ref = useMergedRefs(gridWrapperRef, state.gridWrapper.ref);\n\n // Get the array of children.\n const childrenArray = React.useMemo<\n (React.ReactElement<any> | number | string | Iterable<React.ReactNode> | React.ReactPortal)[]\n >(() => {\n return React.Children.toArray(state.root.children);\n }, [state.root.children]);\n\n // Add motion to the children.\n const childrenWithMotion = React.useMemo(\n () =>\n childrenArray.map((child, index) => {\n // Throw error if the child is not a valid React element or is a Fragment.\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');\n }\n\n // In the collapsed state, if there is one column, we show three children. If there are two or three columns,\n // we show two or three (or four or six, if there are two visible rows). All children are shown in the isExpanded state.\n const visibility = (numberOfColumns === 1 && index < 3) || index < numberOfColumns * visibleRows || isExpanded;\n\n return (\n <PromptStarterMotion\n appear={animateOnMount}\n key={index}\n index={index}\n visible={visibility}\n numberOfColumns={numberOfColumns}\n >\n {child}\n </PromptStarterMotion>\n );\n }),\n [childrenArray, numberOfColumns, isExpanded],\n );\n\n state.root.children = childrenWithMotion;\n\n const numChildren = childrenArray.length;\n if ((numberOfColumns === 1 && numChildren <= 3) || numChildren <= numberOfColumns * visibleRows) {\n state.expandButton = undefined;\n }\n\n if (state.expandButton) {\n state.expandButton.onClick = mergeCallbacks(\n state.expandButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n toggleExpanded,\n );\n }\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","Button","useArrowNavigationGroup","mergeCallbacks","useFluent","useMergedRefs","useDesignVersion","ChevronDown12Regular","PromptStarterMotion","useControllableState","usePromptStarterList_unstable","props","ref","arrowNavigationOptions","expandButtonLabel","collapseButtonLabel","onExpandedChange","animateOnMount","visibleRows","designVersion","focusAttrs","axis","memorizeCurrent","isExpanded","setIsExpanded","state","defaultState","defaultExpanded","initialState","toggleExpanded","useCallback","event","prevExpanded","numberOfColumns","setNumberOfColumns","useState","gridWrapperRef","useRef","targetDocument","win","defaultView","useEffect","current","promptStarterGrid","updateNumberOfColumns","numColumns","getComputedStyle","gridTemplateColumns","split","length","ro","ResizeObserver","observe","unobserve","components","root","gridWrapper","actions","expandButton","always","elementType","defaultProps","role","optional","appearance","size","shape","icon","iconPosition","children","renderByDefault","childrenArray","useMemo","Children","toArray","childrenWithMotion","map","child","index","isValidElement","type","Fragment","Error","visibility","appear","key","visible","numChildren","undefined","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,wBAAwB,EACxBC,IAAI,EACJC,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AAM0E,OAAO,CAEjC;QACA,OAAO1E,MAAM2E,QAAQ,CAACC,OAAO,CAACjD,MAAM8B,IAAI,CAACc,QAAQ;IACnD,GAAG;QAAC5C,MAAM8B,IAAI,CAACc,QAAQ;KAAC;IAExB,8BAA8B;IAC9B,MAAMM,qBAAqB7E,MAAM0E,OAAO,CACtC,IACED,cAAcK,GAAG,CAAC,CAACC,OAAOC;YACxB,0EAA0E;YAC1E,IAAI,eAAChF,MAAMiF,cAAc,CAACF,UAAUA,MAAMG,IAAI,KAAKlF,MAAMmF,QAAQ,EAAE;gBACjE,MAAM,IAAIC,MAAM;YAClB;YAEA,6GAA6G;YAC7G,wHAAwH;YACxH,MAAMC,aAAa,AAAClD,oBAAoB,KAAK6C,QAAQ,KAAMA,QAAQ7C,kBAAkBf,eAAeK;YAEpG,qBACE,oBAACf;gBACC4E,QAAQnE;gBACRoE,KAAKP;gBACLA,OAAOA;gBACPQ,SAASH;gBACTlD,iBAAiBA;eAEhB4C;QAGP,IACF;QAACN;QAAetC;QAAiBV;KAAW;IAG9CE,MAAM8B,IAAI,CAACc,QAAQ,GAAGM;IAEtB,MAAMY,cAAchB,cAActB,MAAM;IACxC,IAAI,AAAChB,oBAAoB,KAAKsD,eAAe,KAAMA,eAAetD,kBAAkBf,aAAa;QAC/FO,MAAMiC,YAAY,GAAG8B;IACvB;IAEA,IAAI/D,MAAMiC,YAAY,EAAE;QACtBjC,MAAMiC,YAAY,CAAC+B,OAAO,GAAGtF,eAC3BsB,MAAMiC,YAAY,CAAC+B,OAAO,EAC1B5D;IAEJ;IAEA,OAAOJ;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptStarter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePromptStarter_unstable } from './usePromptStarter';\nimport { renderPromptStarter_unstable } from './renderPromptStarter';\nimport { usePromptStarterStyles_unstable } from './usePromptStarterStyles.styles';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\nimport type { PromptStarterProps } from './PromptStarter.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const PromptStarter: ForwardRefComponent<PromptStarterProps> = React.forwardRef((props, ref) => {\n const state = usePromptStarter_unstable(props, ref);\n\n usePromptStarterStyles_unstable(state);\n useCustomStyleHook('usePromptStarterStyles')(state);\n\n return renderPromptStarter_unstable(state);\n});\n\nPromptStarter.displayName = 'PromptStarter';\n"],"names":["PromptStarter","React","forwardRef","props","ref","state","usePromptStarter_unstable","usePromptStarterStyles_unstable","useCustomStyleHook","renderPromptStarter_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["PromptStarter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePromptStarter_unstable } from './usePromptStarter';\nimport { renderPromptStarter_unstable } from './renderPromptStarter';\nimport { usePromptStarterStyles_unstable } from './usePromptStarterStyles.styles';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\nimport type { PromptStarterProps } from './PromptStarter.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n/**\n * @deprecated Use PromptStarterV2 instead.\n * Deprecated on 10/21/2025\n */\nexport const PromptStarter: ForwardRefComponent<PromptStarterProps> = React.forwardRef((props, ref) => {\n const state = usePromptStarter_unstable(props, ref);\n\n usePromptStarterStyles_unstable(state);\n useCustomStyleHook('usePromptStarterStyles')(state);\n\n return renderPromptStarter_unstable(state);\n});\n\nPromptStarter.displayName = 'PromptStarter';\n"],"names":["PromptStarter","React","forwardRef","props","ref","state","usePromptStarter_unstable","usePromptStarterStyles_unstable","useCustomStyleHook","renderPromptStarter_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYaA;;;eAAAA;;;;iEAZU;kCACmB;qCACG;8CACG;+BACb;AAQ5B,MAAMA,gBAAAA,WAAAA,GAAyDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQC,IAAAA,2CAAAA,EAA0BH,OAAOC;IAE/CG,IAAAA,6DAAAA,EAAgCF;IAChCG,IAAAA,iCAAAA,EAAmB,0BAA0BH;IAE7C,OAAOI,IAAAA,iDAAAA,EAA6BJ;AACtC;AAEAL,cAAcU,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptStarter.types.ts"],"sourcesContent":["import type { DesignVersion } from '@fluentui-copilot/react-provider';\nimport type { ComponentProps, ComponentState, Slot, BadgeProps } from '@fluentui/react-components';\n\nexport type PromptStarterSlots = {\n root: Slot<'button'>;\n icon: NonNullable<Slot<'span'>>;\n category: NonNullable<Slot<'span'>>;\n prompt?: Slot<'span'>;\n badge?: Slot<BadgeProps>;\n};\n\n/**\n * PromptStarter Props\n */\nexport type PromptStarterProps = ComponentProps<PromptStarterSlots> & DesignVersion & {};\n\n/**\n * State used in rendering PromptStarter\n */\nexport type PromptStarterState = ComponentState<PromptStarterSlots> &\n Pick<Required<PromptStarterProps>, 'designVersion'>;\n"],"names":[],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["PromptStarter.types.ts"],"sourcesContent":["import type { DesignVersion } from '@fluentui-copilot/react-provider';\nimport type { ComponentProps, ComponentState, Slot, BadgeProps } from '@fluentui/react-components';\n\n/**\n * @deprecated Use PromptStarterV2 instead.\n * Deprecated on 10/21/2025\n */\nexport type PromptStarterSlots = {\n root: Slot<'button'>;\n icon: NonNullable<Slot<'span'>>;\n category: NonNullable<Slot<'span'>>;\n prompt?: Slot<'span'>;\n badge?: Slot<BadgeProps>;\n};\n\n/**\n * PromptStarter Props\n * @deprecated Use PromptStarterV2 instead.\n * Deprecated on 10/21/2025\n */\nexport type PromptStarterProps = ComponentProps<PromptStarterSlots> & DesignVersion & {};\n\n/**\n * State used in rendering PromptStarter\n * @deprecated Use PromptStarterV2 instead.\n * Deprecated on 10/21/2025\n */\nexport type PromptStarterState = ComponentState<PromptStarterSlots> &\n Pick<Required<PromptStarterProps>, 'designVersion'>;\n"],"names":[],"rangeMappings":";;;;","mappings":"AAsBA;;;;CAIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderPromptStarter.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { JSXElement } from '@fluentui/react-components';\nimport type { PromptStarterState, PromptStarterSlots } from './PromptStarter.types';\n\nexport const renderPromptStarter_unstable = (state: PromptStarterState): JSXElement => {\n assertSlots<PromptStarterSlots>(state);\n\n return (\n <state.root>\n <state.icon />\n <state.category>\n {state.category.children} {state.badge && <state.badge />}\n </state.category>\n {state.prompt && <state.prompt />}\n </state.root>\n );\n};\n"],"names":["renderPromptStarter_unstable","state","assertSlots","_jsxs","root","_jsx","icon","category","children","badge","prompt"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["renderPromptStarter.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { JSXElement } from '@fluentui/react-components';\nimport type { PromptStarterState, PromptStarterSlots } from './PromptStarter.types';\n\n/**\n * @deprecated Use PromptStarterV2 instead.\n * Deprecated on 10/21/2025\n */\nexport const renderPromptStarter_unstable = (state: PromptStarterState): JSXElement => {\n assertSlots<PromptStarterSlots>(state);\n\n return (\n <state.root>\n <state.icon />\n <state.category>\n {state.category.children} {state.badge && <state.badge />}\n </state.category>\n {state.prompt && <state.prompt />}\n </state.root>\n );\n};\n"],"names":["renderPromptStarter_unstable","state","assertSlots","_jsxs","root","_jsx","icon","category","children","badge","prompt"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;4BAVb;iCAE4B;AAQrB,MAAMA,+BAA+B,CAACC;IAC3CC,IAAAA,4BAAAA,EAAgCD;IAEhC,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAACF,MAAMG,IAAI,EAAA;;0BACTC,IAAAA,eAAA,EAACJ,MAAMK,IAAI,EAAA,CAAA;0BACXH,IAAAA,gBAAA,EAACF,MAAMM,QAAQ,EAAA;;oBACZN,MAAMM,QAAQ,CAACC,QAAQ;oBAAC;oBAAEP,MAAMQ,KAAK,IAAA,WAAA,GAAIJ,IAAAA,eAAA,EAACJ,MAAMQ,KAAK,EAAA,CAAA;;;YAEvDR,MAAMS,MAAM,IAAA,WAAA,GAAIL,IAAAA,eAAA,EAACJ,MAAMS,MAAM,EAAA,CAAA;;;AAGpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptStarter.ts"],"sourcesContent":["import { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport { Badge, getIntrinsicElementProps, slot, useId } from '@fluentui/react-components';\nimport type { PromptStarterProps, PromptStarterState } from './PromptStarter.types';\n\n/**\n * Create the state required to render PromptStarter.\n *\n * The returned state can be modified with hooks such as usePromptStarterStyles_unstable,\n * before being passed to renderPromptStarter_unstable.\n *\n * @param props - props from this instance of PromptStarter\n * @param ref - reference to root HTMLElement of PromptStarter\n */\nexport const usePromptStarter_unstable = (\n props: PromptStarterProps,\n ref: React.Ref<HTMLButtonElement>,\n): PromptStarterState => {\n const designVersion = useDesignVersion(props.designVersion);\n const idPrefix = useId('prompt-starter');\n\n return {\n components: {\n root: 'button',\n icon: 'span',\n category: 'span',\n prompt: 'span',\n badge: Badge,\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n 'aria-labelledby': `${idPrefix}-category`,\n 'aria-describedby': `${idPrefix}-prompt`,\n ...props,\n }),\n { elementType: 'button' },\n ),\n icon: slot.always(props.icon, { elementType: 'span' }),\n category: slot.always(props.category, { defaultProps: { id: `${idPrefix}-category` }, elementType: 'span' }),\n prompt: slot.optional(props.prompt, { defaultProps: { id: `${idPrefix}-prompt` }, elementType: 'span' }),\n badge: slot.optional(props.badge, { defaultProps: { appearance: 'tint' }, elementType: Badge }),\n designVersion,\n };\n};\n"],"names":["usePromptStarter_unstable","props","ref","designVersion","useDesignVersion","idPrefix","useId","components","root","icon","category","prompt","badge","Badge","slot","always","getIntrinsicElementProps","elementType","defaultProps","id","optional","appearance"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["usePromptStarter.ts"],"sourcesContent":["import { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport { Badge, getIntrinsicElementProps, slot, useId } from '@fluentui/react-components';\nimport type { PromptStarterProps, PromptStarterState } from './PromptStarter.types';\n\n/**\n * Create the state required to render PromptStarter.\n *\n * The returned state can be modified with hooks such as usePromptStarterStyles_unstable,\n * before being passed to renderPromptStarter_unstable.\n *\n * @deprecated Use PromptStarterV2 instead.\n * Deprecated on 10/21/2025\n *\n * @param props - props from this instance of PromptStarter\n * @param ref - reference to root HTMLElement of PromptStarter\n */\nexport const usePromptStarter_unstable = (\n props: PromptStarterProps,\n ref: React.Ref<HTMLButtonElement>,\n): PromptStarterState => {\n const designVersion = useDesignVersion(props.designVersion);\n const idPrefix = useId('prompt-starter');\n\n return {\n components: {\n root: 'button',\n icon: 'span',\n category: 'span',\n prompt: 'span',\n badge: Badge,\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n 'aria-labelledby': `${idPrefix}-category`,\n 'aria-describedby': `${idPrefix}-prompt`,\n ...props,\n }),\n { elementType: 'button' },\n ),\n icon: slot.always(props.icon, { elementType: 'span' }),\n category: slot.always(props.category, { defaultProps: { id: `${idPrefix}-category` }, elementType: 'span' }),\n prompt: slot.optional(props.prompt, { defaultProps: { id: `${idPrefix}-prompt` }, elementType: 'span' }),\n badge: slot.optional(props.badge, { defaultProps: { appearance: 'tint' }, elementType: Badge }),\n designVersion,\n };\n};\n"],"names":["usePromptStarter_unstable","props","ref","designVersion","useDesignVersion","idPrefix","useId","components","root","icon","category","prompt","badge","Badge","slot","always","getIntrinsicElementProps","elementType","defaultProps","id","optional","appearance"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;+BAhBoB;iCAC4B;AAetD,MAAMA,4BAA4B,CACvCC,OACAC;IAEA,MAAMC,gBAAgBC,IAAAA,+BAAAA,EAAiBH,MAAME,aAAa;IAC1D,MAAME,WAAWC,IAAAA,sBAAAA,EAAM;IAEvB,OAAO;QACLC,YAAY;YACVC,MAAM;YACNC,MAAM;YACNC,UAAU;YACVC,QAAQ;YACRC,OAAOC,sBAAAA;QACT;QACAL,MAAMM,qBAAAA,CAAKC,MAAM,CACfC,IAAAA,yCAAAA,EAAyB,UAAU;YACjCd;YACA,mBAAmB,CAAC,EAAEG,SAAS,SAAS,CAAC;YACzC,oBAAoB,CAAC,EAAEA,SAAS,OAAO,CAAC;YACxC,GAAGJ,KAAK;QACV,IACA;YAAEgB,aAAa;QAAS;QAE1BR,MAAMK,qBAAAA,CAAKC,MAAM,CAACd,MAAMQ,IAAI,EAAE;YAAEQ,aAAa;QAAO;QACpDP,UAAUI,qBAAAA,CAAKC,MAAM,CAACd,MAAMS,QAAQ,EAAE;YAAEQ,cAAc;gBAAEC,IAAI,CAAC,EAAEd,SAAS,SAAS,CAAC;YAAC;YAAGY,aAAa;QAAO;QAC1GN,QAAQG,qBAAAA,CAAKM,QAAQ,CAACnB,MAAMU,MAAM,EAAE;YAAEO,cAAc;gBAAEC,IAAI,CAAC,EAAEd,SAAS,OAAO,CAAC;YAAC;YAAGY,aAAa;QAAO;QACtGL,OAAOE,qBAAAA,CAAKM,QAAQ,CAACnB,MAAMW,KAAK,EAAE;YAAEM,cAAc;gBAAEG,YAAY;YAAO;YAAGJ,aAAaJ,sBAAAA;QAAM;QAC7FV;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptStarterStyles.styles.ts"],"sourcesContent":["import {\n makeStyles,\n makeResetStyles,\n mergeClasses,\n shorthands,\n typographyStyles,\n createFocusOutlineStyle,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { PromptStarterSlots, PromptStarterState } from './PromptStarter.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptStarterClassNames: SlotClassNames<PromptStarterSlots> = {\n root: 'fai-PromptStarter',\n category: 'fai-PromptStarter__category',\n icon: 'fai-PromptStarter__icon',\n prompt: 'fai-PromptStarter__prompt',\n badge: 'fai-PromptStarter__badge',\n};\n\nconst useRootResetStyles = makeResetStyles({\n position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'auto 1fr',\n gridTemplateRows: 'auto auto',\n gridTemplateAreas: `\n \"icon category\"\n \". prompt\"\n `,\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n fontFamily: tokens.fontFamilyBase,\n cursor: 'pointer',\n outlineStyle: 'none',\n textAlign: 'left',\n gap: '0px 8px',\n padding: '6px 8px 8px 8px',\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1),\n borderRadius: tokens.borderRadiusMedium,\n '&:hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Hover),\n },\n '&:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Pressed),\n },\n ...createFocusOutlineStyle(),\n});\n\nconst useStyles = makeStyles({\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n '&:hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n },\n '&:active': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n },\n },\n icon: { gridArea: 'icon', display: 'flex', alignSelf: 'center' },\n\n category: {\n ...typographyStyles.body1Strong,\n gridArea: 'category',\n },\n prompt: { ...typographyStyles.body1, gridArea: 'prompt' },\n disabledText: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n disabledBadge: {\n opacity: '40%',\n },\n});\n\nconst useNextStyles = makeStyles({ root: { borderRadius: tokens.borderRadiusXLarge } });\n\nexport const usePromptStarterStyles_unstable = (state: PromptStarterState): PromptStarterState => {\n 'use no memo';\n\n const { designVersion } = state;\n\n const styles = useStyles();\n const nextStyles = useNextStyles();\n const rootResetStyles = useRootResetStyles();\n state.root.className = mergeClasses(\n promptStarterClassNames.root,\n rootResetStyles,\n designVersion === 'next' && nextStyles.root,\n state.root.disabled && styles.disabled,\n state.root.className,\n );\n state.icon.className = mergeClasses(\n promptStarterClassNames.icon,\n styles.icon,\n state.root.disabled && styles.disabledText,\n state.icon.className,\n );\n state.category.className = mergeClasses(\n promptStarterClassNames.category,\n styles.category,\n state.category.className,\n state.root.disabled && styles.disabledText,\n );\n if (state.prompt) {\n state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\n state.root.disabled && styles.disabledText,\n state.prompt.className,\n );\n }\n if (state.badge) {\n state.badge.className = mergeClasses(\n promptStarterClassNames.badge,\n state.root.disabled && styles.disabledBadge,\n state.badge.className,\n );\n }\n\n return state;\n};\n"],"names":["promptStarterClassNames","root","category","icon","prompt","badge","useRootResetStyles","makeResetStyles","position","display","gridTemplateRows","gridTemplateAreas","B4j52fo","backgroundColor","tokens","colorNeutralBackground1","color","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","gap","padding","h3c5rm","shorthands","strokeWidthThin","borderRadius","zhjwy3","B2zwrfe","xv9156","colorNeutralBackground1Pressed","Bop6t4b","gvrnp0","createFocusOutlineStyle","Beu9t3s","Bgoe8wy","useStyles","disabled","colorNeutralBackgroundDisabled","B6oc9vd","gridArea","typographyStyles","Ijaq50","disabledText","Be2twd7","disabledBadge","opacity","Bw0ie65","Br312pm","nk6f5a","useNextStyles","Bahqtrf","
|
|
1
|
+
{"version":3,"sources":["usePromptStarterStyles.styles.ts"],"sourcesContent":["import {\n makeStyles,\n makeResetStyles,\n mergeClasses,\n shorthands,\n typographyStyles,\n createFocusOutlineStyle,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { PromptStarterSlots, PromptStarterState } from './PromptStarter.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptStarterClassNames: SlotClassNames<PromptStarterSlots> = {\n root: 'fai-PromptStarter',\n category: 'fai-PromptStarter__category',\n icon: 'fai-PromptStarter__icon',\n prompt: 'fai-PromptStarter__prompt',\n badge: 'fai-PromptStarter__badge',\n};\n\nconst useRootResetStyles = makeResetStyles({\n position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'auto 1fr',\n gridTemplateRows: 'auto auto',\n gridTemplateAreas: `\n \"icon category\"\n \". prompt\"\n `,\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n fontFamily: tokens.fontFamilyBase,\n cursor: 'pointer',\n outlineStyle: 'none',\n textAlign: 'left',\n gap: '0px 8px',\n padding: '6px 8px 8px 8px',\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1),\n borderRadius: tokens.borderRadiusMedium,\n '&:hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Hover),\n },\n '&:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Pressed),\n },\n ...createFocusOutlineStyle(),\n});\n\nconst useStyles = makeStyles({\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n '&:hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n },\n '&:active': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n },\n },\n icon: { gridArea: 'icon', display: 'flex', alignSelf: 'center' },\n\n category: {\n ...typographyStyles.body1Strong,\n gridArea: 'category',\n },\n prompt: { ...typographyStyles.body1, gridArea: 'prompt' },\n disabledText: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n disabledBadge: {\n opacity: '40%',\n },\n});\n\nconst useNextStyles = makeStyles({ root: { borderRadius: tokens.borderRadiusXLarge } });\n\n/**\n * @deprecated Use PromptStarterV2 instead.\n * Deprecated on 10/21/2025\n */\nexport const usePromptStarterStyles_unstable = (state: PromptStarterState): PromptStarterState => {\n 'use no memo';\n\n const { designVersion } = state;\n\n const styles = useStyles();\n const nextStyles = useNextStyles();\n const rootResetStyles = useRootResetStyles();\n state.root.className = mergeClasses(\n promptStarterClassNames.root,\n rootResetStyles,\n designVersion === 'next' && nextStyles.root,\n state.root.disabled && styles.disabled,\n state.root.className,\n );\n state.icon.className = mergeClasses(\n promptStarterClassNames.icon,\n styles.icon,\n state.root.disabled && styles.disabledText,\n state.icon.className,\n );\n state.category.className = mergeClasses(\n promptStarterClassNames.category,\n styles.category,\n state.category.className,\n state.root.disabled && styles.disabledText,\n );\n if (state.prompt) {\n state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\n state.root.disabled && styles.disabledText,\n state.prompt.className,\n );\n }\n if (state.badge) {\n state.badge.className = mergeClasses(\n promptStarterClassNames.badge,\n state.root.disabled && styles.disabledBadge,\n state.badge.className,\n );\n }\n\n return state;\n};\n"],"names":["promptStarterClassNames","root","category","icon","prompt","badge","useRootResetStyles","makeResetStyles","position","display","gridTemplateRows","gridTemplateAreas","B4j52fo","backgroundColor","tokens","colorNeutralBackground1","color","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","gap","padding","h3c5rm","shorthands","strokeWidthThin","borderRadius","zhjwy3","B2zwrfe","xv9156","colorNeutralBackground1Pressed","Bop6t4b","gvrnp0","createFocusOutlineStyle","Beu9t3s","Bgoe8wy","useStyles","disabled","colorNeutralBackgroundDisabled","B6oc9vd","gridArea","typographyStyles","Ijaq50","disabledText","Be2twd7","disabledBadge","opacity","Bw0ie65","Br312pm","nk6f5a","useNextStyles","Bahqtrf","Bg96gwp","designVersion","styles","nextStyles","Bq1tomu","rootResetStyles","className","state","abs64n","p"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,uBAAAA;eAAAA;;;;;;iCANY;AAMlB,MAAMA,0BAA8D;UACzEC;cACAC;UACAC;YACAC;WACAC;AACF;AAEA,MAAMC,qBAAqBC,IAAAA,8BAAAA,EAAAA,YAAgB,YAAA;OACzCC;QAAAA;QAAU;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;OACVC;QAAAA;QAAS;KAAA;;MAETC,YAAAA,IAAAA,yBAAkB,EAAA;cAClBC;;;QAGCC,SAAA;QACDC,SAAAA;YAAAA;YAAiBC;SAAOC;QACxBC,SAAOF;QACPG,QAAAA;YAAAA;YAAmBC;SAAAA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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptStarterStyles.styles.ts"],"sourcesContent":["import {\n makeStyles,\n makeResetStyles,\n mergeClasses,\n shorthands,\n typographyStyles,\n createFocusOutlineStyle,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { PromptStarterSlots, PromptStarterState } from './PromptStarter.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptStarterClassNames: SlotClassNames<PromptStarterSlots> = {\n root: 'fai-PromptStarter',\n category: 'fai-PromptStarter__category',\n icon: 'fai-PromptStarter__icon',\n prompt: 'fai-PromptStarter__prompt',\n badge: 'fai-PromptStarter__badge',\n};\n\nconst useRootResetStyles = makeResetStyles({\n position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'auto 1fr',\n gridTemplateRows: 'auto auto',\n gridTemplateAreas: `\n \"icon category\"\n \". prompt\"\n `,\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n fontFamily: tokens.fontFamilyBase,\n cursor: 'pointer',\n outlineStyle: 'none',\n textAlign: 'left',\n gap: '0px 8px',\n padding: '6px 8px 8px 8px',\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1),\n borderRadius: tokens.borderRadiusMedium,\n '&:hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Hover),\n },\n '&:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Pressed),\n },\n ...createFocusOutlineStyle(),\n});\n\nconst useStyles = makeStyles({\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n '&:hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n },\n '&:active': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n },\n },\n icon: { gridArea: 'icon', display: 'flex', alignSelf: 'center' },\n\n category: {\n ...typographyStyles.body1Strong,\n gridArea: 'category',\n },\n prompt: { ...typographyStyles.body1, gridArea: 'prompt' },\n disabledText: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n disabledBadge: {\n opacity: '40%',\n },\n});\n\nconst useNextStyles = makeStyles({ root: { borderRadius: tokens.borderRadiusXLarge } });\n\nexport const usePromptStarterStyles_unstable = (state: PromptStarterState): PromptStarterState => {\n 'use no memo';\n\n const { designVersion } = state;\n\n const styles = useStyles();\n const nextStyles = useNextStyles();\n const rootResetStyles = useRootResetStyles();\n state.root.className = mergeClasses(\n promptStarterClassNames.root,\n rootResetStyles,\n designVersion === 'next' && nextStyles.root,\n state.root.disabled && styles.disabled,\n state.root.className,\n );\n state.icon.className = mergeClasses(\n promptStarterClassNames.icon,\n styles.icon,\n state.root.disabled && styles.disabledText,\n state.icon.className,\n );\n state.category.className = mergeClasses(\n promptStarterClassNames.category,\n styles.category,\n state.category.className,\n state.root.disabled && styles.disabledText,\n );\n if (state.prompt) {\n state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\n state.root.disabled && styles.disabledText,\n state.prompt.className,\n );\n }\n if (state.badge) {\n state.badge.className = mergeClasses(\n promptStarterClassNames.badge,\n state.root.disabled && styles.disabledBadge,\n state.badge.className,\n );\n }\n\n return state;\n};\n"],"names":["promptStarterClassNames","usePromptStarterStyles_unstable","root","category","icon","prompt","badge","useRootResetStyles","makeResetStyles","position","display","gridTemplateColumns","gridTemplateRows","gridTemplateAreas","backgroundColor","tokens","colorNeutralBackground1","color","colorNeutralForeground1","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","gap","padding","shorthands","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","colorNeutralBackground1Hover","colorNeutralStroke1Hover","colorNeutralBackground1Pressed","colorNeutralStroke1Pressed","createFocusOutlineStyle","useStyles","makeStyles","disabled","colorNeutralBackgroundDisabled","colorNeutralStrokeDisabled","gridArea","alignSelf","typographyStyles","body1Strong","body1","disabledText","colorNeutralForegroundDisabled","disabledBadge","opacity","useNextStyles","borderRadiusXLarge","state","designVersion","styles","nextStyles","rootResetStyles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,uBAAAA;eAAAA;;
|
|
1
|
+
{"version":3,"sources":["usePromptStarterStyles.styles.ts"],"sourcesContent":["import {\n makeStyles,\n makeResetStyles,\n mergeClasses,\n shorthands,\n typographyStyles,\n createFocusOutlineStyle,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { PromptStarterSlots, PromptStarterState } from './PromptStarter.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptStarterClassNames: SlotClassNames<PromptStarterSlots> = {\n root: 'fai-PromptStarter',\n category: 'fai-PromptStarter__category',\n icon: 'fai-PromptStarter__icon',\n prompt: 'fai-PromptStarter__prompt',\n badge: 'fai-PromptStarter__badge',\n};\n\nconst useRootResetStyles = makeResetStyles({\n position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'auto 1fr',\n gridTemplateRows: 'auto auto',\n gridTemplateAreas: `\n \"icon category\"\n \". prompt\"\n `,\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n fontFamily: tokens.fontFamilyBase,\n cursor: 'pointer',\n outlineStyle: 'none',\n textAlign: 'left',\n gap: '0px 8px',\n padding: '6px 8px 8px 8px',\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1),\n borderRadius: tokens.borderRadiusMedium,\n '&:hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Hover),\n },\n '&:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Pressed),\n },\n ...createFocusOutlineStyle(),\n});\n\nconst useStyles = makeStyles({\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n '&:hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n },\n '&:active': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n },\n },\n icon: { gridArea: 'icon', display: 'flex', alignSelf: 'center' },\n\n category: {\n ...typographyStyles.body1Strong,\n gridArea: 'category',\n },\n prompt: { ...typographyStyles.body1, gridArea: 'prompt' },\n disabledText: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n disabledBadge: {\n opacity: '40%',\n },\n});\n\nconst useNextStyles = makeStyles({ root: { borderRadius: tokens.borderRadiusXLarge } });\n\n/**\n * @deprecated Use PromptStarterV2 instead.\n * Deprecated on 10/21/2025\n */\nexport const usePromptStarterStyles_unstable = (state: PromptStarterState): PromptStarterState => {\n 'use no memo';\n\n const { designVersion } = state;\n\n const styles = useStyles();\n const nextStyles = useNextStyles();\n const rootResetStyles = useRootResetStyles();\n state.root.className = mergeClasses(\n promptStarterClassNames.root,\n rootResetStyles,\n designVersion === 'next' && nextStyles.root,\n state.root.disabled && styles.disabled,\n state.root.className,\n );\n state.icon.className = mergeClasses(\n promptStarterClassNames.icon,\n styles.icon,\n state.root.disabled && styles.disabledText,\n state.icon.className,\n );\n state.category.className = mergeClasses(\n promptStarterClassNames.category,\n styles.category,\n state.category.className,\n state.root.disabled && styles.disabledText,\n );\n if (state.prompt) {\n state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\n state.root.disabled && styles.disabledText,\n state.prompt.className,\n );\n }\n if (state.badge) {\n state.badge.className = mergeClasses(\n promptStarterClassNames.badge,\n state.root.disabled && styles.disabledBadge,\n state.badge.className,\n );\n }\n\n return state;\n};\n"],"names":["promptStarterClassNames","usePromptStarterStyles_unstable","root","category","icon","prompt","badge","useRootResetStyles","makeResetStyles","position","display","gridTemplateColumns","gridTemplateRows","gridTemplateAreas","backgroundColor","tokens","colorNeutralBackground1","color","colorNeutralForeground1","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","gap","padding","shorthands","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","colorNeutralBackground1Hover","colorNeutralStroke1Hover","colorNeutralBackground1Pressed","colorNeutralStroke1Pressed","createFocusOutlineStyle","useStyles","makeStyles","disabled","colorNeutralBackgroundDisabled","colorNeutralStrokeDisabled","gridArea","alignSelf","typographyStyles","body1Strong","body1","disabledText","colorNeutralForegroundDisabled","disabledBadge","opacity","useNextStyles","borderRadiusXLarge","state","designVersion","styles","nextStyles","rootResetStyles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,uBAAAA;eAAAA;;IAyEAC,+BAAAA;eAAAA;;;iCA9EN;wBACgB;AAIhB,MAAMD,0BAA8D;IACzEE,MAAM;IACNC,UAAU;IACVC,MAAM;IACNC,QAAQ;IACRC,OAAO;AACT;AAEA,MAAMC,qBAAqBC,IAAAA,gCAAAA,EAAgB;IAC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,IAAI,CAACqC,QAAQ,IAAIgB,OAAOR,YAAY;IAE5C,IAAIM,MAAMhD,MAAM,EAAE;QAChBgD,MAAMhD,MAAM,CAACqD,SAAS,GAAGC,IAAAA,6BAAAA,EACvB3D,wBAAwBK,MAAM,EAC9BkD,OAAOlD,MAAM,EACbgD,MAAMnD,IAAI,CAACqC,QAAQ,IAAIgB,OAAOR,YAAY,EAC1CM,MAAMhD,MAAM,CAACqD,SAAS;IAE1B;IACA,IAAIL,MAAM/C,KAAK,EAAE;QACf+C,MAAM/C,KAAK,CAACoD,SAAS,GAAGC,IAAAA,6BAAAA,EACtB3D,wBAAwBM,KAAK,EAC7B+C,MAAMnD,IAAI,CAACqC,QAAQ,IAAIgB,OAAON,aAAa,EAC3CI,MAAM/C,KAAK,CAACoD,SAAS;IAEzB;IAEA,OAAOL;AACT"}
|
|
@@ -49,12 +49,12 @@ const usePromptStarter_unstable = (props, ref)=>{
|
|
|
49
49
|
},
|
|
50
50
|
elementType: 'span'
|
|
51
51
|
}) : undefined,
|
|
52
|
-
category:
|
|
52
|
+
category: _reactcomponents.slot.optional(props.category, {
|
|
53
53
|
defaultProps: {
|
|
54
54
|
id: `${id}-category`
|
|
55
55
|
},
|
|
56
56
|
elementType: 'span'
|
|
57
|
-
})
|
|
57
|
+
}),
|
|
58
58
|
prompt: _reactcomponents.slot.always(props.prompt, {
|
|
59
59
|
defaultProps: {
|
|
60
60
|
id: `${id}-prompt`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptStarter.ts"],"sourcesContent":["import { getIntrinsicElementProps, slot, useFocusableGroup, useId } from '@fluentui/react-components';\nimport { usePromptStarterListContext } from '../../../contexts/PromptStarterListContext';\nimport type { PromptStarterProps, PromptStarterState } from './PromptStarter.types';\n\n/**\n * Create the state required to render PromptStarter.\n *\n * The returned state can be modified with hooks such as usePromptStarterStyles_unstable,\n * before being passed to renderPromptStarter_unstable.\n *\n * @param props - props from this instance of PromptStarter\n * @param ref - reference to root HTMLElement of PromptStarter\n */\nexport const usePromptStarter_unstable = (\n props: PromptStarterProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptStarterState => {\n const id = useId('prompt-starter');\n const focusAttrs = useFocusableGroup();\n\n const numberOfColumns = usePromptStarterListContext(ctx => ctx.numberOfColumns);\n // if this is defined, the context exists and the Prompt is within PromptStarterList\n const isWithinList = typeof numberOfColumns === 'number';\n\n const isSingleColumn = numberOfColumns === 1;\n\n const state: PromptStarterState = {\n isSingleColumn,\n components: {\n root: 'div',\n primaryAction: 'button',\n icon: 'span',\n category: 'span',\n prompt: 'span',\n reasonMarker: 'span',\n actions: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n role: isWithinList ? 'listitem' : undefined,\n ...focusAttrs,\n ...props,\n }),\n { elementType: 'div' },\n ),\n primaryAction: slot.always(props.primaryAction, {\n defaultProps: {\n 'aria-labelledby': `${id}-category ${id}-prompt`,\n 'aria-describedby': `${id}-icon ${id}-reasonMarker`,\n },\n elementType: 'button',\n }),\n icon: !isSingleColumn\n ? slot.optional(props.icon, {\n defaultProps: { id: `${id}-icon` },\n elementType: 'span',\n })\n : undefined,\n category:
|
|
1
|
+
{"version":3,"sources":["usePromptStarter.ts"],"sourcesContent":["import { getIntrinsicElementProps, slot, useFocusableGroup, useId } from '@fluentui/react-components';\nimport { usePromptStarterListContext } from '../../../contexts/PromptStarterListContext';\nimport type { PromptStarterProps, PromptStarterState } from './PromptStarter.types';\n\n/**\n * Create the state required to render PromptStarter.\n *\n * The returned state can be modified with hooks such as usePromptStarterStyles_unstable,\n * before being passed to renderPromptStarter_unstable.\n *\n * @param props - props from this instance of PromptStarter\n * @param ref - reference to root HTMLElement of PromptStarter\n */\nexport const usePromptStarter_unstable = (\n props: PromptStarterProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptStarterState => {\n const id = useId('prompt-starter');\n const focusAttrs = useFocusableGroup();\n\n const numberOfColumns = usePromptStarterListContext(ctx => ctx.numberOfColumns);\n // if this is defined, the context exists and the Prompt is within PromptStarterList\n const isWithinList = typeof numberOfColumns === 'number';\n\n const isSingleColumn = numberOfColumns === 1;\n\n const state: PromptStarterState = {\n isSingleColumn,\n components: {\n root: 'div',\n primaryAction: 'button',\n icon: 'span',\n category: 'span',\n prompt: 'span',\n reasonMarker: 'span',\n actions: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n role: isWithinList ? 'listitem' : undefined,\n ...focusAttrs,\n ...props,\n }),\n { elementType: 'div' },\n ),\n primaryAction: slot.always(props.primaryAction, {\n defaultProps: {\n 'aria-labelledby': `${id}-category ${id}-prompt`,\n 'aria-describedby': `${id}-icon ${id}-reasonMarker`,\n },\n elementType: 'button',\n }),\n icon: !isSingleColumn\n ? slot.optional(props.icon, {\n defaultProps: { id: `${id}-icon` },\n elementType: 'span',\n })\n : undefined,\n category: slot.optional(props.category, {\n defaultProps: { id: `${id}-category` },\n elementType: 'span',\n }),\n prompt: slot.always(props.prompt, {\n defaultProps: { id: `${id}-prompt` },\n elementType: 'span',\n }),\n reasonMarker: !isSingleColumn\n ? slot.optional(props.reasonMarker, {\n defaultProps: { id: `${id}-reasonMarker` },\n elementType: 'span',\n })\n : undefined,\n actions: !isSingleColumn ? slot.optional(props.actions, { elementType: 'span' }) : undefined,\n };\n\n return state;\n};\n"],"names":["usePromptStarter_unstable","props","ref","id","useId","focusAttrs","useFocusableGroup","numberOfColumns","usePromptStarterListContext","ctx","isWithinList","isSingleColumn","state","components","root","primaryAction","icon","category","prompt","reasonMarker","actions","slot","always","getIntrinsicElementProps","role","undefined","elementType","defaultProps","optional"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;iCAb4D;0CAC7B;AAYrC,MAAMA,4BAA4B,CACvCC,OACAC;IAEA,MAAMC,KAAKC,IAAAA,sBAAAA,EAAM;IACj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