@fluentui-copilot/react-prompt-starter 0.10.2 → 0.10.4
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 +31 -1
- package/CHANGELOG.md +20 -2
- package/dist/index.d.ts +1 -1
- package/lib/PromptStarter.js +0 -1
- package/lib/PromptStarterList.js +0 -1
- package/lib/PromptStarterV2.js +0 -1
- package/lib/components/PromptStarter/PromptStarter.js +5 -6
- package/lib/components/PromptStarter/PromptStarter.types.js +1 -2
- package/lib/components/PromptStarter/index.js +0 -1
- package/lib/components/PromptStarter/renderPromptStarter.js +16 -9
- package/lib/components/PromptStarter/usePromptStarter.js +42 -44
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.raw.js +94 -0
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js +5 -6
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +1 -2
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarter/index.js +0 -1
- package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +61 -50
- package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +15 -9
- package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +50 -51
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +81 -9
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +131 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +5 -6
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +1 -2
- package/lib/components/PromptStarterV2/PromptStarterList/index.js +0 -1
- package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +15 -14
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +97 -97
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +4 -7
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js +61 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js.map +1 -0
- package/lib/contexts/PromptStarterListContext.js +2 -3
- package/lib/index.js +0 -1
- package/lib-commonjs/PromptStarter.js +0 -1
- package/lib-commonjs/PromptStarterList.js +0 -1
- package/lib-commonjs/PromptStarterV2.js +0 -1
- package/lib-commonjs/components/PromptStarter/PromptStarter.js +1 -1
- package/lib-commonjs/components/PromptStarter/PromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/PromptStarter.types.js +0 -1
- package/lib-commonjs/components/PromptStarter/index.js +0 -1
- package/lib-commonjs/components/PromptStarter/renderPromptStarter.js +1 -1
- package/lib-commonjs/components/PromptStarter/renderPromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarter.js +1 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.raw.js +112 -0
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +2 -2
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +9 -8
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +145 -10
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +149 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js +77 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/contexts/PromptStarterListContext.js +1 -1
- package/lib-commonjs/contexts/PromptStarterListContext.js.map +1 -1
- package/lib-commonjs/index.js +0 -1
- package/package.json +3 -3
|
@@ -8,55 +8,54 @@ import { usePromptStarterListContext } from '../../../contexts/PromptStarterList
|
|
|
8
8
|
*
|
|
9
9
|
* @param props - props from this instance of PromptStarter
|
|
10
10
|
* @param ref - reference to root HTMLElement of PromptStarter
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
11
|
+
*/ export const usePromptStarter_unstable = (props, ref)=>{
|
|
12
|
+
const id = useId('prompt-starter');
|
|
13
|
+
const focusAttrs = useFocusableGroup();
|
|
14
|
+
const numberOfColumns = usePromptStarterListContext((ctx)=>ctx.numberOfColumns);
|
|
15
|
+
const isSingleColumn = numberOfColumns === 1;
|
|
16
|
+
const state = {
|
|
17
|
+
isSingleColumn,
|
|
18
|
+
components: {
|
|
19
|
+
root: 'div',
|
|
20
|
+
primaryAction: 'button',
|
|
21
|
+
icon: 'span',
|
|
22
|
+
prompt: 'span',
|
|
23
|
+
reasonMarker: 'span',
|
|
24
|
+
actions: 'span'
|
|
25
|
+
},
|
|
26
|
+
root: slot.always(getIntrinsicElementProps('div', {
|
|
27
|
+
ref,
|
|
28
|
+
'aria-labelledby': `${id}-prompt`,
|
|
29
|
+
'aria-describedby': `${id}-icon, ${id}-reasonMarker`,
|
|
30
|
+
...focusAttrs,
|
|
31
|
+
...props
|
|
32
|
+
}), {
|
|
33
|
+
elementType: 'div'
|
|
34
|
+
}),
|
|
35
|
+
primaryAction: slot.always(props.primaryAction, {
|
|
36
|
+
elementType: 'button'
|
|
37
|
+
}),
|
|
38
|
+
icon: !isSingleColumn ? slot.optional(props.icon, {
|
|
39
|
+
defaultProps: {
|
|
40
|
+
id: `${id}-icon`
|
|
41
|
+
},
|
|
42
|
+
elementType: 'span'
|
|
43
|
+
}) : undefined,
|
|
44
|
+
prompt: slot.always(props.prompt, {
|
|
45
|
+
defaultProps: {
|
|
46
|
+
id: `${id}-prompt`
|
|
47
|
+
},
|
|
48
|
+
elementType: 'span'
|
|
49
|
+
}),
|
|
50
|
+
reasonMarker: !isSingleColumn ? slot.optional(props.reasonMarker, {
|
|
51
|
+
defaultProps: {
|
|
52
|
+
id: `${id}-reasonMarker`
|
|
53
|
+
},
|
|
54
|
+
elementType: 'span'
|
|
55
|
+
}) : undefined,
|
|
56
|
+
actions: !isSingleColumn ? slot.optional(props.actions, {
|
|
57
|
+
elementType: 'span'
|
|
58
|
+
}) : undefined
|
|
59
|
+
};
|
|
60
|
+
return state;
|
|
61
61
|
};
|
|
62
|
-
//# sourceMappingURL=usePromptStarter.js.map
|
|
@@ -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\n const state: PromptStarterState = {\n isSingleColumn
|
|
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\n const isSingleColumn = numberOfColumns === 1;\n\n const state: PromptStarterState = {\n isSingleColumn,\n components: {\n root: 'div',\n primaryAction: 'button',\n icon: 'span',\n prompt: 'span',\n reasonMarker: 'span',\n actions: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n 'aria-labelledby': `${id}-prompt`,\n 'aria-describedby': `${id}-icon, ${id}-reasonMarker`,\n ...focusAttrs,\n ...props,\n }),\n { elementType: 'div' },\n ),\n primaryAction: slot.always(props.primaryAction, {\n elementType: 'button',\n }),\n icon: !isSingleColumn\n ? slot.optional(props.icon, {\n defaultProps: { id: `${id}-icon` },\n elementType: 'span',\n })\n : undefined,\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":["getIntrinsicElementProps","slot","useFocusableGroup","useId","usePromptStarterListContext","usePromptStarter_unstable","props","ref","id","focusAttrs","numberOfColumns","ctx","isSingleColumn","state","components","root","primaryAction","icon","prompt","reasonMarker","actions","always","elementType","optional","defaultProps","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,wBAAwB,EAAEC,IAAI,EAAEC,iBAAiB,EAAEC,KAAK,QAAQ,6BAA6B;AACtG,SAASC,2BAA2B,QAAQ,6CAA6C;AAGzF;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAMC,KAAKL,MAAM;IACjB,MAAMM,aAAaP;IAEnB,MAAMQ,kBAAkBN,4BAA4BO,CAAAA,MAAOA,IAAID,eAAe;IAE9E,MAAME,iBAAiBF,oBAAoB;IAE3C,MAAMG,QAA4B;QAChCD;QACAE,YAAY;YACVC,MAAM;YACNC,eAAe;YACfC,MAAM;YACNC,QAAQ;YACRC,cAAc;YACdC,SAAS;QACX;QACAL,MAAMd,KAAKoB,MAAM,CACfrB,yBAAyB,OAAO;YAC9BO;YACA,mBAAmB,CAAC,EAAEC,GAAG,OAAO,CAAC;YACjC,oBAAoB,CAAC,EAAEA,GAAG,OAAO,EAAEA,GAAG,aAAa,CAAC;YACpD,GAAGC,UAAU;YACb,GAAGH,KAAK;QACV,IACA;YAAEgB,aAAa;QAAM;QAEvBN,eAAef,KAAKoB,MAAM,CAACf,MAAMU,aAAa,EAAE;YAC9CM,aAAa;QACf;QACAL,MAAM,CAACL,iBACHX,KAAKsB,QAAQ,CAACjB,MAAMW,IAAI,EAAE;YACxBO,cAAc;gBAAEhB,IAAI,CAAC,EAAEA,GAAG,KAAK,CAAC;YAAC;YACjCc,aAAa;QACf,KACAG;QACJP,QAAQjB,KAAKoB,MAAM,CAACf,MAAMY,MAAM,EAAE;YAChCM,cAAc;gBAAEhB,IAAI,CAAC,EAAEA,GAAG,OAAO,CAAC;YAAC;YACnCc,aAAa;QACf;QACAH,cAAc,CAACP,iBACXX,KAAKsB,QAAQ,CAACjB,MAAMa,YAAY,EAAE;YAChCK,cAAc;gBAAEhB,IAAI,CAAC,EAAEA,GAAG,aAAa,CAAC;YAAC;YACzCc,aAAa;QACf,KACAG;QACJL,SAAS,CAACR,iBAAiBX,KAAKsB,QAAQ,CAACjB,MAAMc,OAAO,EAAE;YAAEE,aAAa;QAAO,KAAKG;IACrF;IAEA,OAAOZ;AACT,EAAE"}
|
|
@@ -141,9 +141,6 @@ const useStyles = __styles({
|
|
|
141
141
|
Be2twd7: "f13mqy1h",
|
|
142
142
|
Bhrd7zp: "figsok6",
|
|
143
143
|
Bg96gwp: "fcpl73t"
|
|
144
|
-
},
|
|
145
|
-
singleColumnStyles: {
|
|
146
|
-
mc9l5x: "fjseox"
|
|
147
144
|
}
|
|
148
145
|
}, {
|
|
149
146
|
d: [[".fcdwmbt{grid-row:1/3;}", {
|
|
@@ -170,7 +167,79 @@ const useStyles = __styles({
|
|
|
170
167
|
p: -1
|
|
171
168
|
}], ".f5p0z4x{opacity:1;}", [".f1964ud6{transition:opacity var(--durationFast) var(--curveLinear);}", {
|
|
172
169
|
p: -1
|
|
173
|
-
}], ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1rvi9lw{display:-webkit-box;}", ".fpfc2by{-webkit-box-orient:vertical;}", ".f1lvsx7g{-webkit-line-clamp:2;}", ".f1sil6mw{overflow-y:hidden;}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fcpl73t{line-height:var(--lineHeightBase100);}"
|
|
170
|
+
}], ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1rvi9lw{display:-webkit-box;}", ".fpfc2by{-webkit-box-orient:vertical;}", ".f1lvsx7g{-webkit-line-clamp:2;}", ".f1sil6mw{overflow-y:hidden;}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fcpl73t{line-height:var(--lineHeightBase100);}"],
|
|
171
|
+
f: [".ftqa4ok:focus{outline-style:none;}"],
|
|
172
|
+
i: [".f2hkw1w:focus-visible{outline-style:none;}"],
|
|
173
|
+
m: [["@media (forced-colors: active){.f1j6vpng[data-fui-focus-visible]::after{border-top-color:Highlight;}}", {
|
|
174
|
+
m: "(forced-colors: active)"
|
|
175
|
+
}], ["@media (forced-colors: active){.f1ffjurs[data-fui-focus-visible]::after{border-left-color:Highlight;}.f1pniga2[data-fui-focus-visible]::after{border-right-color:Highlight;}}", {
|
|
176
|
+
m: "(forced-colors: active)"
|
|
177
|
+
}], ["@media (forced-colors: active){.f987i1v[data-fui-focus-visible]::after{border-bottom-color:Highlight;}}", {
|
|
178
|
+
m: "(forced-colors: active)"
|
|
179
|
+
}]]
|
|
180
|
+
});
|
|
181
|
+
const useSingleColumnStyles = __styles({
|
|
182
|
+
primaryAction: {
|
|
183
|
+
Beyfa6y: 0,
|
|
184
|
+
Bbmb7ep: 0,
|
|
185
|
+
Btl43ni: 0,
|
|
186
|
+
B7oj6ja: 0,
|
|
187
|
+
Dimara: "f1jxijnj",
|
|
188
|
+
Brovlpu: "ftqa4ok",
|
|
189
|
+
B486eqv: "f2hkw1w",
|
|
190
|
+
B8q5s1w: "f8hki3x",
|
|
191
|
+
Bci5o5g: ["f1d2448m", "ffh67wi"],
|
|
192
|
+
n8qw10: "f1bjia2o",
|
|
193
|
+
Bdrgwmp: ["ffh67wi", "f1d2448m"],
|
|
194
|
+
Bqhya38: "f1j6vpng",
|
|
195
|
+
Bwxa6fj: ["f1pniga2", "f1ffjurs"],
|
|
196
|
+
Bdhvstf: "f987i1v",
|
|
197
|
+
B7zbvrb: ["f1ffjurs", "f1pniga2"],
|
|
198
|
+
Bm4h7ae: "f15bsgw9",
|
|
199
|
+
B7ys5i9: "f14e48fq",
|
|
200
|
+
Busjfv9: "f18yb2kv",
|
|
201
|
+
Bhk32uz: "fd6o370",
|
|
202
|
+
f6g5ot: 0,
|
|
203
|
+
Boxcth7: 0,
|
|
204
|
+
Bhdgwq3: 0,
|
|
205
|
+
hgwjuy: 0,
|
|
206
|
+
Bshpdp8: 0,
|
|
207
|
+
Bsom6fd: 0,
|
|
208
|
+
Blkhhs4: 0,
|
|
209
|
+
Bonggc9: 0,
|
|
210
|
+
Ddfuxk: 0,
|
|
211
|
+
i03rao: 0,
|
|
212
|
+
kclons: 0,
|
|
213
|
+
clg4pj: 0,
|
|
214
|
+
Bpqj9nj: 0,
|
|
215
|
+
B6dhp37: 0,
|
|
216
|
+
Bf4ptjt: 0,
|
|
217
|
+
Bqtpl0w: 0,
|
|
218
|
+
i4rwgc: "ffwy5si",
|
|
219
|
+
Dah5zi: 0,
|
|
220
|
+
B1tsrr9: 0,
|
|
221
|
+
qqdqy8: 0,
|
|
222
|
+
Bkh64rk: 0,
|
|
223
|
+
e3fwne: "f178id4l",
|
|
224
|
+
J0r882: "f57olzd",
|
|
225
|
+
Bule8hv: ["f4stah7", "fs1por5"],
|
|
226
|
+
Bjwuhne: "f480a47",
|
|
227
|
+
Ghsupd: ["fs1por5", "f4stah7"]
|
|
228
|
+
},
|
|
229
|
+
prompt: {
|
|
230
|
+
Bahqtrf: "fk6fouc",
|
|
231
|
+
Be2twd7: "fy9rknc",
|
|
232
|
+
Bhrd7zp: "fl43uef",
|
|
233
|
+
Bg96gwp: "fwrc4pm"
|
|
234
|
+
}
|
|
235
|
+
}, {
|
|
236
|
+
d: [[".f1jxijnj{border-radius:var(--borderRadius2XL);}", {
|
|
237
|
+
p: -1
|
|
238
|
+
}], ".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}", ".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}", ".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}", ".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}", ".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}", ".f14e48fq[data-fui-focus-visible]::after{position:absolute;}", ".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}", ".fd6o370[data-fui-focus-visible]::after{z-index:1;}", [".ffwy5si[data-fui-focus-visible]::after{border:2px solid var(--colorStrokeFocus2);}", {
|
|
239
|
+
p: -2
|
|
240
|
+
}], [".f178id4l[data-fui-focus-visible]::after{border-radius:var(--borderRadius2XL);}", {
|
|
241
|
+
p: -1
|
|
242
|
+
}], ".f57olzd[data-fui-focus-visible]::after{top:calc(2px * -1);}", ".f4stah7[data-fui-focus-visible]::after{right:calc(2px * -1);}", ".fs1por5[data-fui-focus-visible]::after{left:calc(2px * -1);}", ".f480a47[data-fui-focus-visible]::after{bottom:calc(2px * -1);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}"],
|
|
174
243
|
f: [".ftqa4ok:focus{outline-style:none;}"],
|
|
175
244
|
i: [".f2hkw1w:focus-visible{outline-style:none;}"],
|
|
176
245
|
m: [["@media (forced-colors: active){.f1j6vpng[data-fui-focus-visible]::after{border-top-color:Highlight;}}", {
|
|
@@ -189,15 +258,18 @@ export const usePromptStarterStyles_unstable = state => {
|
|
|
189
258
|
} = state;
|
|
190
259
|
const styles = useStyles();
|
|
191
260
|
const rootResetStyles = useRootResetStyles();
|
|
261
|
+
const singleColumnStyles = useSingleColumnStyles();
|
|
192
262
|
state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, state.root.className);
|
|
193
|
-
state.primaryAction.className = mergeClasses(promptStarterClassNames.primaryAction, styles.primaryAction, state.primaryAction.className);
|
|
194
|
-
|
|
195
|
-
|
|
263
|
+
state.primaryAction.className = mergeClasses(promptStarterClassNames.primaryAction, styles.primaryAction, isSingleColumn && singleColumnStyles.primaryAction, state.primaryAction.className);
|
|
264
|
+
if (state.icon) {
|
|
265
|
+
state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, state.icon.className);
|
|
266
|
+
}
|
|
267
|
+
state.prompt.className = mergeClasses(promptStarterClassNames.prompt, styles.prompt, isSingleColumn && singleColumnStyles.prompt, state.prompt.className);
|
|
196
268
|
if (state.reasonMarker) {
|
|
197
|
-
state.reasonMarker.className = mergeClasses(promptStarterClassNames.reasonMarker, styles.reasonMarker,
|
|
269
|
+
state.reasonMarker.className = mergeClasses(promptStarterClassNames.reasonMarker, styles.reasonMarker, state.reasonMarker.className);
|
|
198
270
|
}
|
|
199
271
|
if (state.actions) {
|
|
200
|
-
state.actions.className = mergeClasses(promptStarterClassNames.actions, styles.actions,
|
|
272
|
+
state.actions.className = mergeClasses(promptStarterClassNames.actions, styles.actions, state.actions.className);
|
|
201
273
|
}
|
|
202
274
|
return state;
|
|
203
275
|
};
|
|
@@ -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 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 display: 'flex',\n flexDirection: 'column',\n position: 'relative',\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 rowGap: tokens.spacingHorizontalS,\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 },\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 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 },\n reasonMarker: {\n ...typographyStyles.caption2,\n },\n\n
|
|
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 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 display: 'flex',\n flexDirection: 'column',\n position: 'relative',\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 rowGap: tokens.spacingHorizontalS,\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 },\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 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 },\n reasonMarker: {\n ...typographyStyles.caption2,\n },\n});\n\nconst useSingleColumnStyles = makeStyles({\n primaryAction: {\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 state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\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(promptStarterClassNames.actions, styles.actions, state.actions.className);\n }\n\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","shorthands","typographyStyles","createFocusOutlineStyle","tokens","promptStarterClassNames","root","primaryAction","icon","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","flexDirection","borderRadius","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground2","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","rowGap","spacingHorizontalS","spacingVerticalL","spacingHorizontalL","border","strokeWidthThin","colorNeutralStroke2","style","outlineRadius","primaryActionHovered","alignItems","minHeight","spacingVerticalXXL","spacingVerticalNone","spacingHorizontalNone","durationFast","curveLinear","body1Strong","overflowY","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,QAAQ;IACRC,cAAc;IACdC,SAAS;AACX,EAAE;AAEF,MAAMC,qBAAqBb,gBAAgB;IACzCc,SAAS;IACTC,qBAAqB;IACrBC,kBAAkB;IAClBC,UAAU;IAEV,8DAA8D;IAC9D,WAAW;QACT,CAAC,CAAC,GAAG,EAAEX,wBAAwBE,aAAa,CAAC,CAAC,CAAC,EAAE;YAC/CU,WAAWb,OAAOc,QAAQ;YAC1BC,WAAW;YACXC,YAAY,CAAC,UAAU,EAAEhB,OAAOiB,cAAc,CAAC,CAAC,EAAEjB,OAAOkB,kBAAkB,CAAC,CAAC;QAC/E;IACF;IACA,YAAY;QACV,CAAC,CAAC,GAAG,EAAEjB,wBAAwBE,aAAa,CAAC,CAAC,CAAC,EAAE;YAC/CU,WAAWb,OAAOmB,OAAO;YACzBJ,WAAW;YACXC,YAAY,CAAC,UAAU,EAAEhB,OAAOiB,cAAc,CAAC,CAAC,EAAEjB,OAAOkB,kBAAkB,CAAC,CAAC;QAC/E;IACF;IAEA,2CAA2C;IAC3C,mCAAmC;QACjC,CAAC,CAAC,GAAG,EAAEjB,wBAAwBM,OAAO,CAAC,CAAC,CAAC,EAAE;YACzCa,MAAM;YACN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8D,OAAO9D,YAAY,EACnB4D,MAAM5D,YAAY,CAACiE,SAAS;IAEhC;IACA,IAAIL,MAAM3D,OAAO,EAAE;QACjB2D,MAAM3D,OAAO,CAACgE,SAAS,GAAG3E,aAAaK,wBAAwBM,OAAO,EAAE6D,OAAO7D,OAAO,EAAE2D,MAAM3D,OAAO,CAACgE,SAAS;IACjH;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { makeStyles, makeResetStyles, mergeClasses, shorthands, typographyStyles, createFocusOutlineStyle } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const promptStarterClassNames = {
|
|
4
|
+
root: 'fai-PromptStarter',
|
|
5
|
+
primaryAction: 'fai-PromptStarter__primaryAction',
|
|
6
|
+
icon: 'fai-PromptStarter__icon',
|
|
7
|
+
prompt: 'fai-PromptStarter__prompt',
|
|
8
|
+
reasonMarker: 'fai-PromptStarter__reasonMarker',
|
|
9
|
+
actions: 'fai-PromptStarter__actions'
|
|
10
|
+
};
|
|
11
|
+
const useRootResetStyles = makeResetStyles({
|
|
12
|
+
display: 'grid',
|
|
13
|
+
gridTemplateColumns: '1fr auto',
|
|
14
|
+
gridTemplateRows: 'max-content auto',
|
|
15
|
+
minWidth: '214px',
|
|
16
|
+
// Apply styles to the primary action on hover / active states
|
|
17
|
+
'&:hover': {
|
|
18
|
+
[`& .${promptStarterClassNames.primaryAction}`]: {
|
|
19
|
+
boxShadow: tokens.shadow16,
|
|
20
|
+
transform: 'scale(1.03)',
|
|
21
|
+
transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
'&:active': {
|
|
25
|
+
[`& .${promptStarterClassNames.primaryAction}`]: {
|
|
26
|
+
boxShadow: tokens.shadow8,
|
|
27
|
+
transform: 'scale(1.03)',
|
|
28
|
+
transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
// Hide actions when not focused or hovered
|
|
32
|
+
':not(:focus-within):not(:hover)': {
|
|
33
|
+
[`& .${promptStarterClassNames.actions}`]: {
|
|
34
|
+
clip: 'rect(0px, 0px, 0px, 0px)',
|
|
35
|
+
height: '1px',
|
|
36
|
+
margin: '-1px',
|
|
37
|
+
overflow: 'hidden',
|
|
38
|
+
padding: '0px',
|
|
39
|
+
width: '1px',
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
opacity: 0
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const useStyles = makeStyles({
|
|
46
|
+
primaryAction: {
|
|
47
|
+
gridRow: '1 / 3',
|
|
48
|
+
gridColumn: '1 / 3',
|
|
49
|
+
display: 'flex',
|
|
50
|
+
flexDirection: 'column',
|
|
51
|
+
position: 'relative',
|
|
52
|
+
borderRadius: '28px',
|
|
53
|
+
backgroundColor: tokens.colorNeutralBackground1,
|
|
54
|
+
color: tokens.colorNeutralForeground2,
|
|
55
|
+
fontFamily: tokens.fontFamilyBase,
|
|
56
|
+
cursor: 'pointer',
|
|
57
|
+
outlineStyle: 'none',
|
|
58
|
+
textAlign: 'left',
|
|
59
|
+
rowGap: tokens.spacingHorizontalS,
|
|
60
|
+
padding: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}`,
|
|
61
|
+
...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),
|
|
62
|
+
...createFocusOutlineStyle({
|
|
63
|
+
style: {
|
|
64
|
+
outlineRadius: '28px'
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
},
|
|
68
|
+
primaryActionHovered: {
|
|
69
|
+
boxShadow: tokens.shadow16,
|
|
70
|
+
transform: 'scale(1.03)',
|
|
71
|
+
transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`
|
|
72
|
+
},
|
|
73
|
+
icon: {
|
|
74
|
+
display: 'flex',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
minHeight: tokens.spacingVerticalXXL
|
|
77
|
+
},
|
|
78
|
+
actions: {
|
|
79
|
+
margin: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}
|
|
80
|
+
${tokens.spacingVerticalNone} ${tokens.spacingHorizontalNone}`,
|
|
81
|
+
position: 'relative',
|
|
82
|
+
gridRow: '1 / 2',
|
|
83
|
+
gridColumn: '2 / 3',
|
|
84
|
+
opacity: 1,
|
|
85
|
+
transition: `opacity ${tokens.durationFast} ${tokens.curveLinear}`
|
|
86
|
+
},
|
|
87
|
+
prompt: {
|
|
88
|
+
...typographyStyles.body1Strong,
|
|
89
|
+
// Truncate text after two lines.
|
|
90
|
+
display: '-webkit-box',
|
|
91
|
+
'-webkit-box-orient': 'vertical',
|
|
92
|
+
'-webkit-line-clamp': '2',
|
|
93
|
+
overflowY: 'hidden'
|
|
94
|
+
},
|
|
95
|
+
reasonMarker: {
|
|
96
|
+
...typographyStyles.caption2
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
const useSingleColumnStyles = makeStyles({
|
|
100
|
+
primaryAction: {
|
|
101
|
+
borderRadius: tokens.borderRadius2XL,
|
|
102
|
+
...createFocusOutlineStyle({
|
|
103
|
+
style: {
|
|
104
|
+
outlineRadius: tokens.borderRadius2XL
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
},
|
|
108
|
+
prompt: {
|
|
109
|
+
...typographyStyles.caption1Strong
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
export const usePromptStarterStyles_unstable = (state)=>{
|
|
113
|
+
'use no memo';
|
|
114
|
+
const { isSingleColumn } = state;
|
|
115
|
+
const styles = useStyles();
|
|
116
|
+
const rootResetStyles = useRootResetStyles();
|
|
117
|
+
const singleColumnStyles = useSingleColumnStyles();
|
|
118
|
+
state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, state.root.className);
|
|
119
|
+
state.primaryAction.className = mergeClasses(promptStarterClassNames.primaryAction, styles.primaryAction, isSingleColumn && singleColumnStyles.primaryAction, state.primaryAction.className);
|
|
120
|
+
if (state.icon) {
|
|
121
|
+
state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, state.icon.className);
|
|
122
|
+
}
|
|
123
|
+
state.prompt.className = mergeClasses(promptStarterClassNames.prompt, styles.prompt, isSingleColumn && singleColumnStyles.prompt, state.prompt.className);
|
|
124
|
+
if (state.reasonMarker) {
|
|
125
|
+
state.reasonMarker.className = mergeClasses(promptStarterClassNames.reasonMarker, styles.reasonMarker, state.reasonMarker.className);
|
|
126
|
+
}
|
|
127
|
+
if (state.actions) {
|
|
128
|
+
state.actions.className = mergeClasses(promptStarterClassNames.actions, styles.actions, state.actions.className);
|
|
129
|
+
}
|
|
130
|
+
return state;
|
|
131
|
+
};
|
|
@@ -0,0 +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 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 display: 'flex',\n flexDirection: 'column',\n position: 'relative',\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 rowGap: tokens.spacingHorizontalS,\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 },\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 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 },\n reasonMarker: {\n ...typographyStyles.caption2,\n },\n});\n\nconst useSingleColumnStyles = makeStyles({\n primaryAction: {\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 state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\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(promptStarterClassNames.actions, styles.actions, state.actions.className);\n }\n\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","shorthands","typographyStyles","createFocusOutlineStyle","tokens","promptStarterClassNames","root","primaryAction","icon","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","flexDirection","borderRadius","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground2","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","rowGap","spacingHorizontalS","spacingVerticalL","spacingHorizontalL","border","strokeWidthThin","colorNeutralStroke2","style","outlineRadius","primaryActionHovered","alignItems","minHeight","spacingVerticalXXL","spacingVerticalNone","spacingHorizontalNone","durationFast","curveLinear","body1Strong","overflowY","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,QAAQ;IACRC,cAAc;IACdC,SAAS;AACX,EAAE;AAEF,MAAMC,qBAAqBb,gBAAgB;IACzCc,SAAS;IACTC,qBAAqB;IACrBC,kBAAkB;IAClBC,UAAU;IAEV,8DAA8D;IAC9D,WAAW;QACT,CAAC,CAAC,GAAG,EAAEX,wBAAwBE,aAAa,CAAC,CAAC,CAAC,EAAE;YAC/CU,WAAWb,OAAOc,QAAQ;YAC1BC,WAAW;YACXC,YAAY,CAAC,UAAU,EAAEhB,OAAOiB,cAAc,CAAC,CAAC,EAAEjB,OAAOkB,kBAAkB,CAAC,CAAC;QAC/E;IACF;IACA,YAAY;QACV,CAAC,CAAC,GAAG,EAAEjB,wBAAwBE,aAAa,CAAC,CAAC,CAAC,EAAE;YAC/CU,WAAWb,OAAOmB,OAAO;YACzBJ,WAAW;YACXC,YAAY,CAAC,UAAU,EAAEhB,OAAOiB,cAAc,CAAC,CAAC,EAAEjB,OAAOkB,kBAAkB,CAAC,CAAC;QAC/E;IACF;IAEA,2CAA2C;IAC3C,mCAAmC;Q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D,YAAY,EAAE;QACtB4D,MAAM5D,YAAY,CAACiE,SAAS,GAAG3E,aAC7BK,wBAAwBK,YAAY,EACpC8D,OAAO9D,YAAY,EACnB4D,MAAM5D,YAAY,CAACiE,SAAS;IAEhC;IACA,IAAIL,MAAM3D,OAAO,EAAE;QACjB2D,MAAM3D,OAAO,CAACgE,SAAS,GAAG3E,aAAaK,wBAAwBM,OAAO,EAAE6D,OAAO7D,OAAO,EAAE2D,MAAM3D,OAAO,CAACgE,SAAS;IACjH;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -3,11 +3,10 @@ import { usePromptStarterList_unstable } from './usePromptStarterList';
|
|
|
3
3
|
import { renderPromptStarterList_unstable } from './renderPromptStarterList';
|
|
4
4
|
import { usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';
|
|
5
5
|
import { usePromptStarterListContextValues } from './usePromptStarterListContextValues';
|
|
6
|
-
export const PromptStarterList = /*#__PURE__*/React.forwardRef((props, ref)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export const PromptStarterList = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
7
|
+
const state = usePromptStarterList_unstable(props, ref);
|
|
8
|
+
const contextValues = usePromptStarterListContextValues(state);
|
|
9
|
+
usePromptStarterListStyles_unstable(state);
|
|
10
|
+
return renderPromptStarterList_unstable(state, contextValues);
|
|
11
11
|
});
|
|
12
12
|
PromptStarterList.displayName = 'PromptStarterList';
|
|
13
|
-
//# sourceMappingURL=PromptStarterList.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=PromptStarterList.types.js.map
|
|
1
|
+
export { };
|
|
@@ -2,4 +2,3 @@ export { PromptStarterList } from './PromptStarterList';
|
|
|
2
2
|
export { renderPromptStarterList_unstable } from './renderPromptStarterList';
|
|
3
3
|
export { usePromptStarterList_unstable } from './usePromptStarterList';
|
|
4
4
|
export { promptStarterListClassNames, usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots, PresenceGroup } from '@fluentui/react-components';
|
|
3
3
|
import { PromptStarterListProvider } from '../../../contexts/PromptStarterListContext';
|
|
4
4
|
/**
|
|
5
5
|
* Render the final JSX of PromptStarterList
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
*/ export const renderPromptStarterList_unstable = (state, contextValue)=>{
|
|
7
|
+
assertSlots(state);
|
|
8
|
+
return /*#__PURE__*/ _jsx(PromptStarterListProvider, {
|
|
9
|
+
value: contextValue,
|
|
10
|
+
children: /*#__PURE__*/ _jsxs(state.root, {
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ _jsx(PresenceGroup, {
|
|
13
|
+
children: /*#__PURE__*/ _jsx(state.gridWrapper, {
|
|
14
|
+
children: state.root.children
|
|
15
|
+
})
|
|
16
|
+
}),
|
|
17
|
+
state.expandButton && /*#__PURE__*/ _jsx(state.expandButton, {})
|
|
18
|
+
]
|
|
15
19
|
})
|
|
16
|
-
|
|
17
|
-
})
|
|
18
|
-
});
|
|
20
|
+
});
|
|
19
21
|
};
|
|
20
|
-
//# sourceMappingURL=renderPromptStarterList.js.map
|